namc-utah / NAMCr

NAMC Database and Analysis R API
MIT License
0 stars 0 forks source link

How to enter lists in R? #4

Closed philipbaileynar closed 3 years ago

philipbaileynar commented 3 years ago

@David-Fowler can you help me format the following query please.

The sampleMetrics endpoint takes three arguments:

How do I format the following with a single sample ID?

NAMCr::query('sampleMetrics',list(3,300, sampleIds:list(164638)))
David-Fowler commented 3 years ago

This would be the required syntax for that query:

data = NAMCr::query('sampleMetrics', list(translationId=3, fixedCount=300, sampleIds=c(164638))) or data = NAMCr::query('sampleMetrics', list(translationId=3, fixedCount=300, sampleIds=164638))

Comma separate additional sampleId values in the c(...) array if desired like in the first line above. Single values can skip the c(...) syntax completely.

David-Fowler commented 3 years ago

Added a note to add an enhancement to make this less of an issue for users in the future.

5

philipbaileynar commented 3 years ago

The syntax @David-Fowler provided works.

Screen Shot 2021-06-30 at 11 07 31 AM