section
returns section details from a Pug View request.
section(object, ...)# S3 method for PugViewInstance
section(object, .id = "S1", .verbose = FALSE, ...)
# S3 method for PugViewSectionList
section(object, .id = "S1", .verbose = FALSE, ...)
# S3 method for PugViewSection
section(object, .id = "S1", .verbose = FALSE, ...)
an object returned from get_pug_view.
other arguments. Currently has no effect on the outputs. Can be ignored.
A character value that corresponds to the ID of a specific section. Detailed information about the section with the given section ID will be returned. If NULL, the first section (i.e., "S1") is returned. If there is no section under object
, it returns NULL with a warning. See Note/Details for more information.
A logical value. Should the resulting object be printed to the R console? If TRUE, the object is returned invisibly and the output is printed nicely to the R console. This option may not be available for some slots (or classes). See Notes/Details.
sectionList
# Pug View request for the compound "aspirin (CID = 2244)".
pview <- get_pug_view(identifier = "2244", annotation = "data", domain = "compound")
section(pview, "S1")
section(pview, "S1", .verbose = TRUE)
# List all available sections
sectionList(pview)
# Subsections under the section "S1"
sectionList(section(pview, "S1"))
# Print multiple sections
# section(section(pview, "S1", .verbose = TRUE), "S3", .verbose = TRUE)
Run the code above in your browser using DataLab