Get Column Names from a Time Series Lists
Usage
tsl_colnames_get(tsl = NULL, names = c("all", "shared", "exclusive"))
Arguments
- tsl
(required, list) Time series list. Default: NULL
- names
(optional, character string) Three different sets of column names can be requested:
"all" (default): list with the column names in each zoo object in
tsl
. Unnamed columns are tagged with the string "unnamed"."shared": character vector with the shared column names in at least two zoo objects in
tsl
."exclusive": list with names of exclusive columns (if any) in each zoo object in
tsl
.
See also
Other tsl_management:
tsl_burst()
,
tsl_colnames_clean()
,
tsl_colnames_prefix()
,
tsl_colnames_set()
,
tsl_colnames_suffix()
,
tsl_count_NA()
,
tsl_diagnose()
,
tsl_handle_NA()
,
tsl_join()
,
tsl_names_clean()
,
tsl_names_get()
,
tsl_names_set()
,
tsl_names_test()
,
tsl_ncol()
,
tsl_nrow()
,
tsl_repair()
,
tsl_subset()
,
tsl_time()
,
tsl_time_class_set()
,
tsl_to_df()
Examples
#generate example data
tsl <- tsl_simulate()
#list all column names
tsl_colnames_get(
tsl = tsl,
names = "all"
)
#> $A
#> [1] "a" "b" "c" "d" "e"
#>
#> $B
#> [1] "a" "b" "c" "d" "e"
#>
#change one column name
names(tsl[[1]])[1] <- "new_column"
#all names again
tsl_colnames_get(
tsl = tsl,
names = "all"
)
#> $A
#> [1] "new_column" "b" "c" "d" "e"
#>
#> $B
#> [1] "a" "b" "c" "d" "e"
#>
#shared column names
tsl_colnames_get(
tsl = tsl,
names = "shared"
)
#> $A
#> [1] "b" "c" "d" "e"
#>
#> $B
#> [1] "b" "c" "d" "e"
#>
#exclusive column names
tsl_colnames_get(
tsl = tsl,
names = "exclusive"
)
#> $A
#> [1] "new_column"
#>
#> $B
#> [1] "a"
#>