tsl_names_clean | R Documentation |
Combines utils_clean_names()
and tsl_names_set()
to help clean, abbreviate, capitalize, and add a suffix or a prefix to time series list names.
tsl_names_clean(
tsl = NULL,
lowercase = FALSE,
separator = "_",
capitalize_first = FALSE,
capitalize_all = FALSE,
length = NULL,
suffix = NULL,
prefix = NULL
)
tsl |
(required, list) Time series list. Default: NULL |
lowercase |
(optional, logical) If TRUE, all names are coerced to lowercase. Default: FALSE |
separator |
(optional, character string) Separator when replacing spaces and dots. Also used to separate |
capitalize_first |
(optional, logical) Indicates whether to capitalize the first letter of each name Default: FALSE. |
capitalize_all |
(optional, logical) Indicates whether to capitalize all letters of each name Default: FALSE. |
length |
(optional, integer) Minimum length of abbreviated names. Names are abbreviated via |
suffix |
(optional, character string) Suffix for the clean names. Default: NULL. |
prefix |
(optional, character string) Prefix for the clean names. Default: NULL. |
time series list
Other tsl_management:
tsl_burst()
,
tsl_colnames_clean()
,
tsl_colnames_get()
,
tsl_colnames_prefix()
,
tsl_colnames_set()
,
tsl_colnames_suffix()
,
tsl_count_NA()
,
tsl_diagnose()
,
tsl_handle_NA()
,
tsl_join()
,
tsl_names_get()
,
tsl_names_set()
,
tsl_names_test()
,
tsl_ncol()
,
tsl_nrow()
,
tsl_repair()
,
tsl_subset()
,
tsl_time()
,
tsl_to_df()
#initialize time series list
tsl <- tsl_initialize(
x = fagus_dynamics,
name_column = "name",
time_column = "time"
)
#original names
tsl_names_get(
tsl = tsl
)
#abbreviate names
#---------------------------
tsl_clean <- tsl_names_clean(
tsl = tsl,
capitalize_first = TRUE,
length = 4 #abbreviate to 4 characters
)
#new names
tsl_names_get(
tsl = tsl_clean
)
#suffix and prefix
#---------------------------
tsl_clean <- tsl_names_clean(
tsl = tsl,
capitalize_all = TRUE,
separator = "_",
suffix = "fagus",
prefix = "country"
)
#new names
tsl_names_get(
tsl = tsl_clean
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.