[R] Assignemt problem ,,,,,,,,,,,,,,,

Stefano Calza stecalza at tiscali.it
Fri Jun 16 11:32:31 CEST 2006


Hi,

your matix has 5 rows and 6 columns. So, either you do 

ind <- 1:5
res[,1] <- ind

or 

dim(res) <- c(6,5)

HIH,
Stefano


On Fri, Jun 16, 2006 at 09:13:54AM -0000, anil kumar rohilla wrote:
<anil> ?
<anil>Hello list,
<anil>     i have a very simple question about matrix assignment.
<anil>
<anil>i did like this.
<anil>res<-1:30
<anil>dim(res)<-c(5,6)
<anil>
<anil>ind<-1:6
<anil>
<anil>now i want to assign the value of this variable ind to first coloumn in matrix res.
<anil>
<anil>like 
<anil>res[,1]<-ind
<anil>
<anil>but this code is giving error , Actualy i have a for loop and value of ind variable is changing every time ,,total 6 times,,i want to assign every vlaue of ind (5 times) to each coloumn of res,,please help me in this regards
<anil>
<anil>anil
<anil>
<anil>
<anil>ANIL KUMAR( METEOROLOGIST)
<anil>LRF SECTION 
<anil>NATIONAL CLIMATE CENTER 
<anil>ADGM(RESEARCH)
<anil>INDIA METEOROLOGICAL DEPARTMENT
<anil>SHIVIJI NAGAR
<anil>PUNE-411005 INDIA
<anil>MOBILE +919422023277
<anil>anilkumar a imdpune.gov.in
<anil>
<anil>	[[alternative HTML version deleted]]
<anil>

<anil>______________________________________________
<anil>R-help a stat.math.ethz.ch mailing list
<anil>https://stat.ethz.ch/mailman/listinfo/r-help
<anil>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html



More information about the R-help mailing list