Sets the names of a time series list and the internal names of the zoo objects inside, stored in their attribute "name".
tsl_names_set(tsl =NULL, names =NULL)
Arguments
tsl: (required, list) Time series list. Default: NULL
names: (optional, character vector) names to set. Must be of the same length of x. If NULL, and the list x has names, then the names of the zoo objects inside of the list are taken from the names of the list elements.
Returns
time series list
Examples
#simulate time series listtsl <- tsl_simulate(n =3)#assess validitytsl_diagnose( tsl = tsl
)#list and zoo names (default)tsl_names_get( tsl = tsl
)#list namestsl_names_get( tsl = tsl, zoo =FALSE)#renaming list items and zoo objects#------------------------------------tsl <- tsl_names_set( tsl = tsl, names = c("X","Y","Z"))# check new namestsl_names_get( tsl = tsl
)#fixing naming issues#------------------------------------#creating a invalid time series listnames(tsl)[2]<-"B"# check namestsl_names_get( tsl = tsl
)#validate tsl#returns NOT VALID#recommends a solutiontsl_diagnose( tsl = tsl
)#fix issue with tsl_names_set()#uses names of zoo objects for the list itemstsl <- tsl_names_set( tsl = tsl
)#validate againtsl_diagnose( tsl = tsl
)#list namestsl_names_get( tsl = tsl
)