#initialize time series list
tsl <- tsl_initialize(
x = fagus_dynamics,
name_column = "name",
time_column = "time"
)
#checking available dimensions
#names
tsl_names_get(
tsl = tsl
)
#colnames
tsl_colnames_get(
tsl = tsl
)
#time
tsl_time(
tsl = tsl
)[, c("name", "begin", "end")]
#subset
tsl_new <- tsl_subset(
tsl = tsl,
names = c("Sweden", "Germany"),
colnames = c("rainfall", "temperature"),
time = c("2010-01-01", "2015-01-01")
)
#check new dimensions
#names
tsl_names_get(
tsl = tsl_new
)
#colnames
tsl_colnames_get(
tsl = tsl_new
)
#time
tsl_time(
tsl = tsl_new
)[, c("name", "begin", "end")]
Run the code above in your browser using DataLab