Takes objects of class tbl_df
, list
or xml_document
and converts
them to a tibble with a structure required by lightparser
. Note that
delma
represents these as an object of class tbl_lp
for convenience.
Usage
as_lp_tbl(x, ...)
# S3 method for class 'tbl_lp'
as_lp_tbl(x, ...)
# S3 method for class 'tbl_df'
as_lp_tbl(x, ...)
# S3 method for class 'list'
as_lp_tbl(x, ...)
# S3 method for class 'xml_document'
as_lp_tbl(x, ...)
Value
An object of class tbl_lp
, tbl_df
, tbl
and data.frame
, containing
the following fields:
type
(chr) Whether that section is e.g. YAML, inline text, heading, or code blocklabel
(chr) The tag associated with a given code block (otherwise NA)params
(list) Attributes of a code blocktext
(list) Any text in that sectioncode
(list) Any code in that sectionheading
(chr) Fortype
=heading
, the value of that headingheading_level
(dbl) The heading level of that heading (i.e. number of#
)section
(chr) The heading this section sits within
Examples
if (FALSE) { # \dontrun{
df <- xml2::read_xml("https://collections.ala.org.au/ws/eml/dr368") |>
as_lp_tbl()
} # }