I am running a machine that only has R 2.10 and cannot be updated (this is a fact: it cannot be changed).
I need to use the "expm" package's functionality for taking the kth power of a matrix (it is the function %^%
) but I cannot figure out how to copy the source code, since the earliest version of this package was made for versions later than R 2.10. On R, after installing the expm
package, running:
library(expm)
getAnywhere('%^%')
gives me the source code, but then when I copy this source code in the form %^% <- *source code*
, I get the error
Error in stopifnot(is.numeric(x) || is(x, "dMatrix"), length(d <- dim(x)) == :
object 'x' not found
Can anyone help me figure out how to use the original implementation of %^% via source code?
使用反引号`表示非语法名称。
`%^%` <- ....
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.