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
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
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();
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
4 matches
Mail list logo