dkahle / mpoly

Symbolic computing with multivariate polynomials in R
https://dkahle.github.io/mpoly/
12 stars 12 forks source link

mpolyList cannot be run inside a function #2

Closed gitlongor closed 9 years ago

gitlongor commented 9 years ago
library(mpoly)
b=mp('1')
mpolyList(b) ## this is OK

f=function(){
    a=mp('1')
    mpolyList(a)
}

f() ## object 'a' not found

gives error with the following call stack

Error in get(as.character(l)) : object 'a' not found

Enter a frame number, or 0 to exit   

1: f()
2: #3: mpolyList(a)
3: lapply(arguments, function(l) get(as.character(l)))
4: FUN(X[[i]], ...)
5: get(as.character(l))
dkahle commented 9 years ago

Got it, thanks!