Zoo time series do not have an attribute 'name'. However, within distantia, to keep data consistency in several plotting and analysis operations, an attribute 'name' is used for these objects. This function is a convenient wrapper of attr(x = x, which = "name") <- "xxx".
zoo_name_set(x =NULL, name =NULL)
Arguments
x: (required, zoo object) Zoo time series to analyze. Default: NULL.
name: (required, character string) name or new name of the zoo object. If NULL, x is returned as is. Default: NULL
Returns
zoo time series
Examples
#simulate zoo time seriesx <- zoo_simulate()#get current namezoo_name_get(x = x)#change namex <- zoo_name_set( x = x, name ="My.New.name")zoo_name_get(x = x)#clean namex <- zoo_name_clean( x = x, lowercase =TRUE)zoo_name_get(x = x)