Re: [R] Accessing Named Column in a Matrix

From: jim holtman <jholtman_at_gmail.com>
Date: Mon, 23 Jun 2008 22:07:40 -0400

It does not appear that the 'print' statment agrees with the output of 'str'. It appears that you only have a 3x2 matrix in the 'print', while the 'str' indicates a 150x80 matrix. Can you "provide commented, minimal, self-contained, reproducible code" so it is easier to see what the problem might be.

Also you might choose another name besides 'data' since that is also a function in R.

On Mon, Jun 23, 2008 at 9:12 PM, Gundala Viswanath <gundalav_at_gmail.com> wrote:
> Hi,
>
> How can I access the "var" column in this matrix
>
>>print(data)
>
> var
> [1,] 1372.23718 2.277450e+04
> [2,] 74.48333 5.494448e+01
> [3,] 226.63590 6.023199e+02
>
> I've had a look with
>
>> str(data)
>
> num [1:150, 1:80] 30.9 8.6 8.5 159.7 1.7 ...
> - attr(*, "dimnames")=List of 2
> ..$ : NULL
> ..$ : chr [1:80] "" "" "" "" ...
>
>
> But can't seem to make sense how to access "var" value.
> I've also tried with
>
> data$var
>
> But still fail to access "var" column
>
>
> - Gundala Viswanath
> Jakarta - Indonesia
>
> ______________________________________________
> R-help_at_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.
>

-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

______________________________________________
R-help_at_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.
Received on Tue 24 Jun 2008 - 02:12:35 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 25 Jun 2008 - 15:30:47 GMT.

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

list of date sections of archive