Re: [R] strange behavior of R

2010-01-09 Thread Liviu Andronic
On Fri, Jan 8, 2010 at 10:57 PM, Fahim wrote: >> arr > [1] "y1" "y2" > At this moment 'arr' no longer has two dimensions, but only one. So you can access it only as a vector. > Problem: I want to access the first row now using: >>arr[1, ] > Error in arr[1, 1] : incorrect number of dimensions > Co

Re: [R] strange behavior of R

2010-01-08 Thread David Winsemius
On Jan 8, 2010, at 5:57 PM, Fahim wrote: Hi I observed an interesting behavior of R. Can you find where is the bug, or it is not a bug but made deliberately. - Hide quoted text - arr = c();#defined the empty array a= c("x1", "x2"); b = c("y1", "y2"); arr = rbind(a

Re: [R] strange behavior of R

2010-01-08 Thread Sarah Goslee
You need to reread the help for [, specifically the drop argument. ?"[" Sarah On Fri, Jan 8, 2010 at 5:57 PM, Fahim wrote: > > Hi > I observed an interesting behavior of R. Can you find where is the bug, or > it is not a bug but made deliberately. > - Hide quoted text - > > >> arr = c();      

[R] strange behavior of R

2010-01-08 Thread Fahim
Hi I observed an interesting behavior of R. Can you find where is the bug, or it is not a bug but made deliberately. - Hide quoted text - > arr = c();#defined the empty array > a= c("x1", "x2"); > b = c("y1", "y2"); > arr = rbind(arr,a);#row bind