get_pug_view {PubChemR}R Documentation

Retrieve PUG View Data from PubChem

Description

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.

Usage

get_pug_view(
  annotation = NULL,
  identifier = NULL,
  domain = "compound",
  output = "JSON",
  heading = NULL,
  headingType = NULL,
  page = NULL,
  qrSize = "short",
  save = FALSE
)

Arguments

annotation

A character string specifying the type of annotation to retrieve.

identifier

A single identifier for the query, either numeric or character.

domain

A character string specifying the domain for the request. Default is 'compound'.

output

A character string specifying the output format. Possible values are 'JSON', 'XML', and 'SVG'. Default is 'JSON'.

heading

An optional character string for specifying a heading in the request.

headingType

An optional character string for specifying a heading type in the request.

page

An optional character string for specifying a page number in the request.

qrSize

A character string specifying the size of the QR code. Possible values are 'short' and 'long'. Default is 'short'.

save

A logical value indicating whether to save the output. Default is FALSE.

Value

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.

Examples

  get_pug_view(identifier = "2244", annotation = "linkout", domain = "compound")


[Package PubChemR version 1.2 Index]