Question

Consider the following commands (2 examples)

curl -H "Accept:text/plain" http://rxnav.nlm.nih.gov/REST/rxcui/866350/allrelated 

curl -i -L -H "Accept: application/xml"  http://pub.orcid.org/search/orcid-bio?q=digital-object-ids:"10.1088/0031-9155/58/3/535"

The user is able to run those on win7 command line with curl.exe installed. The RCurl package has no vignette and it has a lot of commands to choose from. How do I get the text file and XML file output using RCurl?

Was it helpful?

Solution

I think you can use the following :

mytxt <- getURL("http://rxnav.nlm.nih.gov/REST/rxcui/866350/allrelated", httpheader=c(Accept="text/plain"))

And :

myxml <- getURL('http://pub.orcid.org/search/orcid-bio?q=digital-object-ids:"10.1088/0031-9155/58/3/535"', httpheader=c(Accept="application/xml"))

You will find many examples in the getURL help page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top