glottoclean: Clean glottodata/glottosubdata

View source: R/glottoclean.R

glottocleanR Documentation

Clean glottodata/glottosubdata

Description

This function cleans glottodata/glottosubdata and returns a simplified glottodata/glottosubdata object containing only the cleaned data table and a structure table.

Usage

glottoclean(
  glottodata,
  tona = NULL,
  tofalse = NULL,
  totrue = NULL,
  id = NULL,
  glottosample = FALSE,
  one_level_drop = TRUE
)

Arguments

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.

Details

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.

Value

A cleaned-up and simplified version of the original glottodata object

Examples

glottodata <- glottoget("demodata", meta = TRUE)
glottodata <- glottoclean(glottodata)

glottosubdata <- glottoget("demosubdata", meta = TRUE)
glottosubdata <- glottoclean(glottosubdata)

SietzeN/glottospace documentation built on June 15, 2024, 10:45 p.m.