On Fri, Jan 8, 2010 at 10:57 PM, Fahim <fahim...@gmail.com> 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
>
Correct. It has only one dim.

> Though it is showing the value  as under:
>> arr[1]
> [1] "y1"
>
>> arr[2]
> [1] "y2"
>
This is how you would access individual elements in vectors.
Liviu

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to