glottoclean | R Documentation |
This function cleans glottodata/glottosubdata and returns a simplified glottodata/glottosubdata object containing only the cleaned data table and a structure table.
glottoclean(
glottodata,
tona = NULL,
tofalse = NULL,
totrue = NULL,
id = NULL,
glottosample = FALSE,
one_level_drop = TRUE
)
glottodata |
glottodata (either a list or a data.frame) |
tona |
Optional additional values to recode to NA (besides default) |
tofalse |
Optional additional values to recode to FALSE (besides default) |
totrue |
Optional additional values to recode to TRUE (besides default) |
id |
By default, glottoclean looks for a column named 'glottocode', if the id is in a different column, this should be specified. |
glottosample |
Should the sample table be used to subset the data? |
one_level_drop |
A logical value to denote whether or not to drop variables with a single value, the default value is TRUE. |
This function has some built in default values that are being recoded: For example, if column type is 'symm' or 'asymm', values such as "No" and 0 are recoded to FALSE Values such as "?" are recoded to NA.
A cleaned-up and simplified version of the original glottodata object
glottodata <- glottoget("demodata", meta = TRUE)
glottodata <- glottoclean(glottodata)
glottosubdata <- glottoget("demosubdata", meta = TRUE)
glottosubdata <- glottoclean(glottosubdata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.