I was surprised when I was calculating derivatives (using the library mosaic) in Rstudio like

fun=makeFun(x^2~x)

D(fun~x)

it says

Error in D(fun ~ x) : argument "name" is missing, with no default

I tried it in R, it turned out the same problem. Anyone could help? Thanks!