#' Get subclassification by language
#'
#' Takes any vector of languoids and returns subclassification in the Newick tree format.
#' @param x A character vector of the languoids (can be written in lower case)
#' @author George Moroz <agricolamz@gmail.com>
#' @seealso \code{\link{aff.lang}}, \code{\link{area.lang}}, \code{\link{country.lang}}, \code{\link{gltc.lang}}, \code{\link{iso.lang}}, \code{\link{lat.lang}}, \code{\link{long.lang}}
#' @examples
#' subc.lang('Korean')
#' subc.lang(c('Korean', 'Lechitic'))
#' @export
subc.lang <- function(x) {
if (typeof(x) == "list") {
x <- unlist(x)
}
glottolog <- lingtypology::glottolog
vapply(x, function(y) {
ifelse(
is.glottolog(y, response = TRUE) == TRUE,
glottolog[tolower(glottolog$language) %in% tolower(y), ]$subclassification,
NA_character_
)
}, character(1))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.