select | R Documentation |
Utility function to select periods from a data.frame. This function is inspired by openair::selectByDate.
select(
data,
year,
month,
day,
hour,
minutes,
seconds,
start,
end,
range,
time = "date"
)
data |
data.frame with model or observation data |
year |
numeric vector for selection |
month |
numeric vector (1-12) for selection, can be abbreviated to 3 or more letters |
day |
numeric vector (1-31) for selection, weekdays can be abbreviated to 3 or more letters, or weekday/weekend |
hour |
numeric vector (0-23) for selection |
minutes |
numeric vector (0-60) for selection |
seconds |
numeric vector (0-60) for selection |
start |
POSIXct or character (YYYY-MM-DD) with the initial date of selection |
end |
POSIXct or character (YYYY-MM-DD) with the initial date of selection |
range |
pair of start/end or a data.frame with time (default is "date") |
time |
name of the column for time (default is "date") |
data.frame
See %IN%
for selection based on position and model domains.
model <- readRDS(paste0(system.file("extdata",package="eva3dm"),
"/model.Rds"))
summary(model)
summary(select(data = model, start = '2012-01-09'))
summary(select(data = model, start = '2012-01-05', end = '2012-01-09'))
summary(select(data = model, day = 6))
summary(select(data = model, hour = 12))
summary(select(data = model, day = 6, hour = 12))
summary(select(data = model, day = 'weekday'))
summary(select(data = model, day = 'weekend'))
summary(select(data = model, day = 'tue'))
summary(select(data = model, day = 'jan'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.