interpret_variable_names: Interpret variable names

View source: R/interpret_variable_names.R

interpret_variable_namesR Documentation

Interpret variable names

Description

Adds labels to variable names that are provided without labels

Usage

interpret_variable_names(x, type)

Arguments

x

Vector of names of variables

type

The label to add (either of "locus", "edge", "individual" or "trait")

Details

The function adds the specified label to the variable names. For example, "Fst" becomes "locus_Fst" if type = "locus". It will not add a label if it detects that the label is already there, i.e. "locus_Fst" will stay "locus_Fst".

Value

A vector of strings

Note

In the case of type = "trait" some variable names will be considered exceptions to which not to add a label. These are the variables that are saved per time point and/or per ecotype or habitat but not per trait ("EI", "RI", "SI", "population_sizes", "ecotype_population_sizes" and "habitat_resources")

Examples


interpret_variable_names(c("Fst", "Qst"), "locus")
interpret_variable_names(c("corbreed", "corfreq"), "edge")


rscherrer/speciomer documentation built on March 11, 2023, 5:37 p.m.