glottocreate {glottospace} | R Documentation |
Generate empty glottodata or glottosubdata for a set of glottocodes.
Description
Creates glottodata/glottosubdata and optionally save it as excel file.
Usage
glottocreate(
glottocodes,
variables,
meta = TRUE,
filename = NULL,
simplify = TRUE,
groups = NULL,
n = NULL,
levels = NULL,
check = FALSE,
maintainer = NULL,
email = NULL,
citation = NULL,
url = NULL
)
Arguments
glottocodes |
Character vector of glottocodes |
variables |
Either a vector with variable names, or a single number indicating the total number of variable columns to be generated |
meta |
Should metatables be created? |
filename |
Optional name of excel file where to store glottodata |
simplify |
By default, if a glottodata table is created without metadata, the data will be returned as a data.frame (instead of placing the data inside a list of length 1) |
groups |
Character vector of group names (only for glottosubdata) |
n |
Optional, number of records to be assigned to each group (only for glottosubdata) |
levels |
Optional character vector with levels across all variables |
check |
Should glottocodes be checked? Default is FALSE because takes much time to run. |
maintainer |
Name of the person/organization maintaining the data (optional) |
email |
Email address of maintainer/contact person (optional) |
citation |
How to cite the data (optional) |
url |
Optional url linking to a webpage. |
Details
By default, glottodata will be created. In case a groups argument is provided, glottosubdata will be created.
glottodata has one table for all languages (and a number of metatables if meta = TRUE), with one row per glottocode. glottosubdata has one table for each language (and a number of metatables if meta = TRUE), with one row per glottosubcode.
Run glottoget("demodata") or glottoget("demosubdata") to see examples.
In case you already have your own dataset and want to convert it into glottodata, use: glottoconvert().
Value
A glottodata or glottosubdata object (either with or without metadata). The output can be a list or a data.frame.
Examples
# Creates glottodata table without metadata tables
glottocreate(glottocodes = c("yucu1253", "tani1257"),
variables = 3, meta = FALSE)
# Creates glottodata table with metadata tables (stored in a list):
glottocreate(glottocodes = c("yucu1253", "tani1257"), variables = 3)
# Creates glottosubdata table (stored in a list)
glottocreate(glottocodes = c("yucu1253", "tani1257"),
variables = 3, groups = c("a", "b") )