knitr::opts_chunk$set( collapse = TRUE, fig.width = 7, comment = "#>" )
This vignette only highlights the most basic functions and shows a way to get to your data quickly.
conn <- connect_idaifield(pwd = "hallo", project = "rtest") db <- get_idaifield_docs(connection = conn) index <- get_uid_list(db)
Using the following few lines and all default arguments while selecting from the whole database:
library(dplyr) pottery <- db %>% idf_select_by(by = "category", value = "Pottery") %>% # Note: simplify_idaifield() needs the index of the complete project database # as a lookup-table to replace all UUIDs with their identifiers simplify_idaifield(uidlist = index) %>% idaifield_as_matrix() %>% as.data.frame()
Or using the following few lines with direct queries to the database:
pottery <- idf_query(connection = conn, field = "type", value = "Pottery") %>% simplify_idaifield(uidlist = index) %>% idaifield_as_matrix() %>% as.data.frame()
See also: ?idf_index_query
, ?idf_query
and ?idf_json_query
.
Downloading translations and converting them into a lookup table:
core_lang_list <- download_language_list(project = "core", language = "de") pergamon_lang_list <- download_language_list(project = "Pergamon", language = "de") config_lang_list <- get_configuration(attr(db, "connection")) config_lang_list <- config_lang_list$languages lookup <- get_language_lookup(core_lang_list, language = "de") lookup <- rbind(lookup, get_language_lookup(pergamon_lang_list, language = "de")) lookup <- rbind(lookup, get_language_lookup(config_lang_list, language = "de")) head(lookup)
colnames(pottery) translated <- colnames(pottery) names(translated) <- lookup$label[match(translated, lookup$var)] translated
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.