Comments (3)
Nevermind, I did find a solution:
list2env(myfun, environment())
Deriv(f)
#function (x)
#par * x^(par - 1)
I'll leave it here in case anyone else have the same problem.
from deriv.
Right. As the error message suggests, get()
cannot use expression with $
or any subindexing to find an object. It must be a plain name like f
in your second example.
from deriv.
After some reflexion, I have found a way to circumvent get()
limitations and now (i.e. starting from v3.8.4) your example gives:
(fd<-Deriv(myfun$f))
# function (x)
# par * x^(par - 1)
# <environment: 0x29034b8>
fd(3)
# [1] 6
Please feel free to report any problem with proposed solution.
PS. The version 3.8.4 is not on CRAN yet (as of this writing) but you can test it with usual
devtools::install_github("sgsokol/Deriv")
from deriv.
Related Issues (20)
- Issue with non-standard evaluation HOT 2
- problem with string formatting HOT 2
- Incorrect derivatives? HOT 5
- incorporating custom drules in a downstream package HOT 2
- Part of results gets into function arguments? HOT 1
- Things like c(x, y) ^ 2 are not supported HOT 3
- feature request: make it possible to extend Deriv by defining primitives HOT 3
- Can't simplify `y + c(1, 2)` HOT 1
- Simplify `y + c(0, 1)` fails HOT 2
- Matrix calculus HOT 12
- support for genetic functions? HOT 6
- browser() HOT 2
- Error about the derivative for product HOT 2
- Problems with applying Deriv() to dbinom(). HOT 12
- Bug using long expressions in Deriv() related to deparse() HOT 1
- Error in missing(FALSE) : invalid use of 'missing' HOT 4
- problem with composite function HOT 3
- Error in FUN(X[[i]], ...) : Could not retrieve body of '[()' HOT 14
- Issues in Simplify.log HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deriv.