I am new to R. I want to fill in an empty matrix with the results of my for
loop using cbind
. My question is, how can I eliminate the NAs in the first column of my matrix. I include my code below:
output<-matrix(,15,) ##generate an empty matrix with 15 rows, the first column already filled with NAs, is there any way to leave the first column empty?
for(`enter code here`){
normF<-`enter code here`
output<-cbind(output,normF)
}
The output is the matrix I expected. The only issue is that its first column is filled with NAs. How can I delete those NAs?