Hi R-users

I'm writing a code to run a fuction but I found an error that I can't fix. I
reproduced the error with a simple example.

The correct answer is k but I can't fill my s matrix. What I'm doing wrong?


 s<-matrix(data=NA,nrow=1,ncol=5 )
 s

for(i in 1:5)
      {
      k=sqrt(i)
      s[,i]<-k[i]
   print(k)
      }

s

Thanks in advance,

Marlene.

	[[alternative HTML version deleted]]

