Rectangle the output of odata_submission_get(parse=FALSE)
into a tidy tibble and unnest all levels.
Source: R/odata_submission_rectangle.R
odata_submission_rectangle.Rd
Usage
odata_submission_rectangle(
data,
names_repair = "universal",
names_sep = "_",
form_schema = NULL,
verbose = get_ru_verbose()
)
Arguments
- data
A nested list of lists as given by
odata_submission_get
.- names_repair
The argument
names_repair
fortidyr::unnest_wider
, default: "universal".- names_sep
The argument
names_sep
fortidyr::unnest_wider
, default: "_". Un-nested variables inside a list column will be prefixed by the list column name, separated bynames_sep
. This avoids unsightly repaired names such aslatitude...1
.- form_schema
An optional form_schema, like the output of
form_schema
. If a form schema is supplied, location fields will not be unnested. While WKT location fields contain plain text and will never be unnested, GeoJSON location fields would cause errors during unnesting.- verbose
Whether to display debug messages or not.
Read
vignette("setup", package = "ruODK")
to learn howruODK
's verbosity can be set globally or per function.
Details
This function cleans names with janitor::clean_names()
and drops the
prefix value_
.
See also
Other utilities:
attachment_get()
,
attachment_link()
,
attachment_url()
,
drop_null_coords()
,
form_schema_parse()
,
get_one_attachment()
,
get_one_submission()
,
get_one_submission_att_list()
,
get_one_submission_audit()
,
handle_ru_attachments()
,
handle_ru_datetimes()
,
handle_ru_geopoints()
,
handle_ru_geoshapes()
,
handle_ru_geotraces()
,
isodt_to_local()
,
predict_ruodk_name()
,
prepend_uuid()
,
split_geopoint()
,
split_geoshape()
,
split_geotrace()
,
strip_uuid()
,
tidyeval
,
unnest_all()
Examples
if (FALSE) { # \dontrun{
# Using canned data
data_parsed <- odata_submission_rectangle(fq_raw, verbose = TRUE)
# Field "device_id" is known part of fq_raw
testthat::expect_equal(
data_parsed$device_id[[1]],
fq_raw$value[[1]]$device_id
)
# fq_raw has two submissions
testthat::expect_equal(length(fq_raw$value), nrow(data_parsed))
} # }