Description Usage Arguments Value Examples
View source: R/preprocess-txt.R
sep_col
is split into multiple columns given by into
.
If column ageclass is present and values start with 0 one is added
to align with agestructure in other functions. Columns without any informations
(length(unique()) == 1
) are dropped. If the first time step only
has zeros as values remove these values. remove zeros overall!
1 | preprocess_txt(df_txt, sep_col = "code", into)
|
df_txt |
Dataframe read in with |
sep_col |
Column to separate into multiple columns. Default is |
into |
Character vector given the columns to split sep_col in. |
Tidy dataframe.
1 2 3 4 5 6 7 8 | d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools")
df <- load_txt(file = file.path(d, "outputSETASSpecificPredMort.txt"))
df <- preprocess_txt(df_txt = df, into = c("pred", "agecl", "empty_col1", "prey", "empty_col2"))
head(df)
df <- load_txt(file = file.path(d, "outputSETASSpecificMort.txt"))
df <- preprocess_txt(df_txt = df, into = c("species", "agecl", "empty_col", "mort"))
head(df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.