Joins an arbitrary of time series lists by name and time. Pairs of zoo objects are joined with zoo::merge.zoo(). Names that are not shared across all input TSLs are ignored, and observations with no matching time are filled with NA and then managed via tsl_handle_NA() depending on the value of the argument na_action.
tsl_join(..., na_action ="impute")
Arguments
...: (required, time series lists) names of the time series lists to merge.
na_action: (required, character) NA handling action. Available options are:
"impute" (default): NA cases are interpolated from neighbors as a function of time (see zoo::na.approx() and zoo::na.spline()).
"omit": rows with NA cases are removed.
Returns
time series list
Examples
#generate two time series list to jointsl_a <- tsl_simulate( n =2, cols =2, irregular =TRUE, seed =1)#needs renamingtsl_b <- tsl_simulate( n =3, cols =2, irregular =TRUE, seed =2)|> tsl_colnames_set( names = c("c","d"))#jointsl <- tsl_join( tsl_a, tsl_b
)#plot resultif(interactive()){ tsl_plot( tsl = tsl
)}