z**********i 发帖数: 88 | 1 I wonder why n[1:4] doesn't return the length of the 4 variables in dataset
MMSCORE. My code is below:
n[1:4]<-length(MMSCORE[,c(4:7)]).
All I wanted to get are the length of the 4th,5th,6th, and 7th variables in
dataset MMSCORE. The lengths should be the same. 740. But it returns to 4,4,
4,4.
With this code, it does returns the correct length.n<-length(MMSCORE[,7])
Thanks! | l*********s 发帖数: 5409 | 2 apply(MMSCORE[,c(4:7)], 2, length) | z**********i 发帖数: 88 | 3 thank you very much!
Thanks! |
|