get_queryId_results: Get results of a ChemSpider query

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/FILTERING-get_queryId_results.R

Description

This function is used to retrieve the results of a ChemSpider query after chemspiderapi::get_queryId_status() returns "Complete".

Usage

1
2
3
4
5
6
7
8
get_queryId_results(
  queryId,
  status,
  start = NULL,
  count = NULL,
  apikey,
  coerce = FALSE
)

Arguments

queryId

A valid 36-character ChemSpider query ID string; see Details.

status

A character string indicating the query status as returned by chemspiderapi::get_queryId_status()

start

Optional: An integer value giving the position from which to start the retrieval of query results. See Details.

count

Optional: An integer value giving the the number of query results to retrieve. See Details.

apikey

A 32-character string with a valid key for ChemSpider's API services.

coerce

logical: should the list be coerced to a data.frame? Defaults to FALSE.

Details

Before running chemspiderapi::get_queryId_results(), make sure chemspiderapi::get_queryId_status() returns "Complete". In fact, this function will return "NA" if the status is not "Complete".

If the results have been truncated because there were more results than the maximum number of results permitted (by default, 10,000), a warning is issued. If this happens, you can split your requests into smaller batches.

To batch your requests, call this function with two optional parameters, start and count. Both take integer values. start is the number of the record to start with (zero-based), and count is the number of records to return. For example, to request results 200-300, use start = 200L and count = 100L.

Value

A character vector indicating the status of the query; see Details.

Author(s)

Raoul Wolf (https://github.com/RaoulWolf/)

See Also

https://developer.rsc.org/compounds-v1/apis/get/filter/{queryId}/results

Examples

1
2
3
4
5
6
7
8
## Not run: 
## Get results of a query from ChemSpider
queryId <- "A valid 36-character Chemspider query ID"
apikey <- "A valid 32-character Chemspider API key"
status <- get_queryId_status(queryId = queryId, apikey = apikey)
get_queryId_results(queryId = queryId, status = status, apikey = apikey)

## End(Not run)

NIVANorge/chemspiderapi documentation built on Jan. 10, 2021, 10:12 a.m.