## Not run:
# url <- 'http://api.plos.org/search'
# solr_stats(q='science', stats.field='counter_total_all', base=url, raw=TRUE)
# solr_stats(q='title:"ecology" AND body:"cell"',
# stats.field=c('counter_total_all','alm_twitterCount'), base=url)
# solr_stats(q='ecology', stats.field=c('counter_total_all','alm_twitterCount'),
# stats.facet='journal', base=url)
# solr_stats(q='ecology', stats.field=c('counter_total_all','alm_twitterCount'),
# stats.facet=c('journal','volume'), base=url)
#
# # Get raw data, then parse later if you feel like it
# ## json
# out <- solr_stats(q='ecology', stats.field=c('counter_total_all','alm_twitterCount'),
# stats.facet=c('journal','volume'), base=url, raw=TRUE)
# library(rjson)
# fromJSON(out)
# solr_parse(out) # list
# solr_parse(out, 'df') # data.frame
#
# ## xml
# out <- solr_stats(q='ecology', stats.field=c('counter_total_all','alm_twitterCount'),
# stats.facet=c('journal','volume'), base=url, raw=TRUE, wt="xml")
# library(XML)
# xmlParse(out)
# solr_parse(out) # list
# solr_parse(out, 'df') # data.frame
#
# # Get verbose http call information
# library(httr)
# solr_stats(q='ecology', stats.field='alm_twitterCount', base=url,
# callopts=verbose())
# ## End(Not run)
Run the code above in your browser using DataLab