trying to create a new matrix by subtracting columns in a given matrix using R

后端 未结 0 1890
感情败类
感情败类 2020-12-19 16:58
mat_sub <- function(x){
nc <- ncol(x)
  for (i in 1:nc){
    s <- x[,nc-i]-x[nc]
 }

Z <- cbind(x,s) Z }

Please help in understand

相关标签:
回答
  • 消灭零回复
提交回复
热议问题