I tried the above function with simple search terms and it worked fine
for me (also more output thanks to Martin's post) but when I use
search terms attributed to certain fields, i.e. with [au] or [ta], I
get the following error message:
pm.srch()
1: "laryngeal neoplasms[mh]"
2:
Read 1 item
Fehler in .Call("RS_XML_ParseTree", as.character(file), handlers,
as.logical(ignoreBlanks), :
error in creating parser for
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&ter
m=laryngeal neoplasms[mh]
I/O warning : failed to load external entity
"http%3A//eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi%3Fdb=pubme
d&term=laryngeal%20neoplasms%5Bmh%5D"
What's wrong?
I'm not sure. You included my simple example. rather than your search string
that provoked an error. This is an example search that one can find on
the how-to page for literature searches with /esearch:
http://www.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&term=PNAS[ta]+AND+97[vi]&retstart=6&retmax=6&tool=biomed3
I am wondering if you used spaces, rather than "+"'s? If so then you may
want your function to do more gsub-processing of the input string.
When I use the search terms in NCBI's example I get: