RAnEn::formatForecasts generates the AnEn Forecasts list required by analog computation.
formatForecasts(
df,
col.par,
col.x,
col.y,
col.time,
col.lead.time,
time.series,
col.value,
verbose = T,
preview = 2,
remove.duplicates = T,
circular.pars = NULL,
col.station.name = NULL,
show.progress = F,
sort.stations = NULL
)
A data frame to be converted to an R list.
The column name for parameter names.
The column name for station x coordinates.
The column name for station y coordinates.
The column name for forecast cycle time. The column should be POSIXct.
The column name for forecast lead time. The column should be numeric for the number of seconds from the forecast cycle time.
The forecast cycle times to be extract into AnEn Forecasts. This should be a POSIXct vector.
The column name for data values.
Whether to print progress messages.
How many entries to preview in progress messages.
Whether to remove redundant values associated with the same time. Sometimes, it is possible that, due to equipment mulfunctions, there are multiple measurements at the same time. Idealy this should cleaned prior to this function, but this function is able to keep the first appearance and remove the rest.
A character vector for the circular parameter names.
The column name for station names.
Whether to show a progress bar.
Sort station. It can be Xs
, Ys
, or StationNames
if it is set.
An R list for AnEn Forecasts.
The AnEn Forecasts is an R list with members including ParameterNames
,
Xs
, Ys
, Data
, and etc., with a full list accessible
here.
RAnEn::formatForecasts make it easier to convert a data frame into
a such list data structure.
I read this tutorial
when developing functions with dplyr
. It is very informative of using variables
with dplyr
functions.
RAnEn::formatObservations