Re: [R] Assignemt problem ,,,,,,,,,,,,,,,

From: Stefano Calza <stecalza_at_tiscali.it>
Date: Fri 16 Jun 2006 - 19:32:31 EST

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@imdpune.gov.in
<anil>
<anil> [[alternative HTML version deleted]]
<anil>

<anil>______________________________________________
<anil>R-help@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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jun 16 19:33:15 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 16 Jun 2006 - 22:12:37 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.