r - enter line to an object -
hello in r how write function takes input number @ aline should entered existing object
matrix(rnorm(9),ncol=3,nrow=5) x<-c(1,7,8)
each vector should entered matrix matrix @ row 3 (so should new co row 3 . other rows pushed old row 3 row 4 then
one way of doing can :
aa<- matrix(rnorm(9),ncol=3,nrow=5) x<-c(1,7,8) rbind(aa[1:2,],x,aa[3:5,])
a similar solution ot this, actually: r: insert vector row in data.frame
Comments
Post a Comment