Learn R Programming

timeDF (version 0.9.0)

timeDF-package: tools:::Rd_package_title("timeDF")

Description

tools:::Rd_package_description("timeDF")

Arguments

Author

tools:::Rd_package_author("timeDF") Maintainer: tools:::Rd_package_maintainer("timeDF")

Details

Package timeDF provides functionality to deal with times with the use of periods. With period information, data frames with time information are subset and flagged.

See Also

timeDF-class periodDF-class as.timeDF as.periodDF vec_to_periodDF extract_with_periodDF flag_with_periodDF

Examples

Run this code
library(timeDF)
time_df = data.frame(
    time = c("2023-01-01 12:00:00",
             "2023-01-21 12:00:00",
             "2023-02-10 12:00:00",
             "2023-03-02 12:00:00",
             "2023-03-22 12:00:00",
             "2023-04-11 12:00:00"
    ),
    value = c(123, 144, 150, 100, 130, 145)
)

timeDF = as.timeDF(time_df)

period_df = data.frame(
    start = c("2023-01-01",
              "2023-03-01"),
    end = c("2023-01-31",
            "2023-03-31")
)
periodDF = as.periodDF(period_df, "date")

extract_with_periodDF(timeDF, periodDF, "both")

Run the code above in your browser using DataLab