Well, here is what I do:
D(expression(x^2),"x") # 2 * x D(as.expression(x^2),"x") # [1] 0 class(as.expression(x^2)) # [1] "expression" class(expression(x^2)) # [1] "expression"
So why a different result? I believe that R handles these things a little differently, and I want to understand how exactly. A guide to R in which such nuances are covered, if you know one, is also very welcome.
source share