次の関数の導関数を取得するにはどうすればよいですか?
g <- expression(x^2)
derivg <- D(g, 'x')
derivg
# 2 * x
g1 <- derivg(2)
# Error: could not find function "derivg"
x = 2 での導関数を求めたいと思います。
次の関数の導関数を取得するにはどうすればよいですか?
g <- expression(x^2)
derivg <- D(g, 'x')
derivg
# 2 * x
g1 <- derivg(2)
# Error: could not find function "derivg"
x = 2 での導関数を求めたいと思います。