convert_to_long_format {forcis}R Documentation

Reshape and simplify FORCIS data

Description

Reshapes FORCIS data by pivoting species columns into two columns: taxa (taxon names) and counts (taxon abundances). It converts wider data.frame to a long format.

Usage

convert_to_long_format(data)

Arguments

data

a tibble or a data.frame, i.e. a FORCIS dataset, except for CPR North data.

Value

A tibble reshaped in a long format.

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)

# Reshape data ----
net_data <- convert_to_long_format(net_data)

# Dimensions of the data.frame ----
dim(net_data)

# Column names ----
colnames(net_data)

[Package forcis version 1.0.1 Index]