我试图将matrix
函数参数“翻译”成葡萄牙语:
portuguese.matrix <- function(dados = NA,nlin = 1,ncol = 1,porlin = FALSE,dimnomes = NULL) {
matrix(data,nrow,ncol,byrow,dimnames)
}
所以,我试图获得以下输出:
matrix(data = rnorm(9),nrow = 3,ncol = 3,dimnames = list(c("a","b","c"),c("d","e","f")))
d e f
a 0.01874617 -0.5991677 -1.208076
b -0.18425254 0.2945451 -0.363676
c -1.37133055 0.3897943 -1.626673
这就是我得到的:
portuguese.matrix(dados = rnorm(9),nlin = 3,dimnomes = list(c("a","f")))
Error in as.vector(x,mode) :
cannot coerce type 'closure' to vector of type 'any'
Called from: as.vector(data)
Browse[1]>
R studio打开一个显示以下内容的窗口:
有关如何解决此问题的任何提示?