[R] Extract function parameters from a R expression

Sigbert Klinke @igbert @ending from wiwi@hu-berlin@de
Wed Jun 20 10:08:11 CEST 2018


Hi,

I have read an R program with

expr <- parse("myRprg.R")

How can I extract the parameters of a specifc R command, e.g. "library"?

So, if myprg.R containes the lines

library("xyz")
library("abc")

then I would like to get "xyz" and "abc" back from expr.

Thanks in advance

Sigbert

-- 
https://hu.berlin/sk




More information about the R-help mailing list