Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用包中的nthroot功能pracma。但是,每当我运行它时,都会出现错误:
nthroot
pracma
nthroot(x, 5) 中的错误:找不到函数“nthroot”
我尝试安装该pracma软件包,但这也无济于事。谁能给我任何关于为什么这不起作用的想法?
做就是了
x ^ (1 / n)
根在哪里n。
n
nthroot 处理负数,例如返回 nthroot(-2,3) == -1.259921,而不是 NA
要自己定义:
nthroot = function(x,n) { (abs(x)^(1/n))*sign(x) }