Filter dataframe for data of one specified year only.
get_data_for_year.Rd
Filter dataframe for data of one specified year only.
Examples
# Example using a small sample data frame
power_data <- data.frame(
timestamp = c(
as.POSIXct("2000-01-01 01:00:00", tz = "UTC"),
as.POSIXct("2001-01-02 01:00:00", tz = "UTC"),
as.POSIXct("2002-02-01 02:00:00", tz = "UTC"),
as.POSIXct("2003-02-02 02:00:00", tz = "UTC")
),
total_input = c(1.0, 2.0, 3.0, 4.0),
total_output = c(4.0, 3.0, 2.0, 1.0)
)
get_data_for_year(power_data, 2002)
#> timestamp total_input total_output
#> 1 2002-02-01 02:00:00 3 2