[R] Accessing Element of a Table
Peter Ehlers
ehlers at ucalgary.ca
Fri Oct 1 16:12:45 CEST 2010
On 2010-10-01 7:43, Gundala Viswanath wrote:
> I have the following structure:
>
>> str(propn)
> table [1:2(1d)] 0.674 0.326
> - attr(*, "dimnames")=List of 1
> ..$ label: chr [1:2] "o" "x"
>
>
>> print(propn)
> label
> o x
> 0.6738347 0.3261653
>
>
> How can I access the value of "o" and "x"
>
> I tried this but fail
>> print(propn$label[,"o"];
>
> - G.V.
Try propn[["o"]]
-Peter Ehlers
More information about the R-help
mailing list