This function sends a request to the PubChem PUG View API to retrieve various types of data for a given identifier. It supports fetching annotations, QR codes, and more, with options for different output formats including JSON and SVG.
get_pug_view(
annotation = NULL,
identifier = NULL,
domain = "compound",
output = "JSON",
heading = NULL,
headingType = NULL,
page = NULL,
qrSize = "short",
save = FALSE
)
Depending on the output format, this function returns different types of content: JSON or JSONP format returns parsed JSON content. SVG format returns an image object. For QR codes, it returns an image object or saves a PNG file.
A character string specifying the type of annotation to retrieve.
A single identifier for the query, either numeric or character.
A character string specifying the domain for the request. Default is 'compound'.
A character string specifying the output format. Possible values are 'JSON' and 'SVG'. Default is 'JSON'.
An optional character string for specifying a heading in the request.
An optional character string for specifying a heading type in the request.
An optional character string for specifying a page number in the request.
A character string specifying the size of the QR code. Possible values are 'short' and 'long'. Default is 'short'.
A logical value indicating whether to save the output. Default is FALSE.
get_pug_view(identifier = "2244", annotation = "linkout", domain = "compound")
Run the code above in your browser using DataLab