Hi, I'm new to R so sorry if this is a stupid question. Can anyone explain to me how come my columns and rows for matrix 'test1' isn't renamed after i execute my function? Is my understanding of functions wrong and it's just designed badly?
test1 <- cbind(1:6)
rename <- function(a){
rownames(a) <- c(1:6)
colnames(a) <- "a"
}
rename(test1)
test1
Thanks for your help in advance