Learn R Programming

emuR (version 0.1.8)

AddListRemoveLabelGroup: Add / List / Remove global labelGroup to / of / from emuDB

Description

Add / List / Remove label group that can be used as a short hand to reference groups of labels that are globally defined for the entire database (compared to attribute definition specific label groups that are added by add_attrDefLabelGroup) in a query. A common example would be to add a label group for something like the phonetic category of nasals to be able to reference them as "nasals" in a query. In theory you could use a labelGroupName as a label instance within the level, but since this could lead to serious confusion, it is better avoided. For users transitioning from the legacy EMU system: Do not confuse a labelGroup with legal labels: a labelGroup had the unfortunate name 'legal labels' in the legacy EMU system. For more information on the structural elements of an emuDB see vignette{emuDB}.

Usage

add_labelGroup(emuDBhandle, name, values)
list_labelGroups(emuDBhandle)
remove_labelGroup(emuDBhandle, name)

Arguments

emuDBhandle
emuDB handle as returned by load_emuDB
name
name of label group
values
character vector of labels

See Also

add_attrDefLabelGroup

Examples

Run this code
## Not run: 
# 
# ##################################
# # prerequisite: loaded ae emuDB 
# # (see ?load_emuDB for more information)
# 
# sampaNasals = c("m", "F", "n", "J", "N")
# 
# # add these values to the ae emuDB
# # as a globally available labelGroup
# add_labelGroup(emuDBhandle = ae,
#                name = "sampaNasals",
#                values = sampaNasals)
# 
# # query the labelGroup in the "Phonetic" level
# query(emuDBhandle = ae, 
#       query = "Phonetic == sampaNasals")
# 
# # query the labelGroup in the "Phoneme" level
# query(emuDBhandle = ae, 
#       query = "Phoneme == sampaNasals")
# 
# # list global label groups of ae emuDB
# list_labelGroups(emuDBhandle = ae)
# 
# # remove the newly added labelGroup
# remove_labelGroup(emuDBhandle = ae,
#                   name = "sampaNasals")
# ## End(Not run)

Run the code above in your browser using DataLab