1

Using scopus in r to retrieve references

library(rscopus)
auth_token_header("please_add")
akey="please_add"
set_api_key(akey)
x = abstract_retrieval("10.1109/TPAMI.2018.2798607", identifier= "doi")

Executing this it is possible to take the result

x$content$`abstracts-retrieval-response`$`item`$bibrecord$tail$`bibliography`$reference[[1]]$`ref-info`$`ref-title`

How is it possible to execute the command and take the result if we have this:

a = 1
ref <- paste("x$content$`abstracts-retrieval-response`$`item`$bibrecord$tail$`bibliography`$reference[[",a,"]]$`ref-info`$`ref-title`")
Elr Mant
  • 507
  • 1
  • 4
  • 14
  • I agree with @DiceboyT, the use of `parse` is often fraught with peril (and often really-difficult-to-troubleshoot bugs). Perhaps you can step back and explain why you want to indirectly reference like this? There might be better ways to accomplish what you *need* vice attacking your problem with this method. – r2evans Jan 29 '19 at 18:36

1 Answers1

4

You can use parse with eval:

eval(parse(text = "sum(1:10)"))
#[1] 55

Although generally you should try to reformulate your problem to avoid having to do this.

fortunes::fortune("parse")
#If the answer is parse() you should usually rethink the question.
#   -- Thomas Lumley
#      R-help (February 2005)
dave-edison
  • 3,666
  • 7
  • 19