Selects columns in FORCIS data. Because FORCIS data contains more than 100
columns, this function can be used to lighten the data.frame to easily
handle it and to speed up some computations.
Arguments
- data
a
tibbleor adata.frame. One obtained byread_*_data()functions.- cols
a
charactervector of column names to keep in addition to the required ones (seeget_required_columns()) and to the taxa columns. Can beNULL(default).
Examples
# Import example dataset ----
file_name <- system.file(file.path("extdata", "FORCIS_net_sample.csv"),
package = "forcis")
net_data <- read.csv(file_name)
# Dimensions of the data.frame ----
dim(net_data)
#> [1] 2451 86
# Select a taxonomy ----
net_data <- select_taxonomy(net_data, taxonomy = "VT")
# Dimensions of the data.frame ----
dim(net_data)
#> [1] 2451 80
# Select only required columns (and taxa) ----
net_data <- select_forcis_columns(net_data)
# Dimensions of the data.frame ----
dim(net_data)
#> [1] 2451 77
