[R] question on how to extract values from atomic vector

From: Jack Luo <jluo.rhelp_at_gmail.com>
Date: Wed, 9 Jan 2008 22:12:34 -0500


Dear List,

I have an atomic vector named "Results"

Results
[1] 1 1 1
attr(,"prob")
[1] 0.6666667 1.0000000 1.0000000

Levels: 0 1

when I type

attributes(Results)
$levels
[1] "0" "1"

$class
[1] "factor"

$prob
[1] 0.6666667 1.0000000 1.0000000

However, when I type
Results$prob

It has the following warning message:

NULL
Warning message:
In Results$prob : $ operator is invalid for atomic vectors, returning NULL

I've been doing some search and seems that this question was asked by someone before and I can not seem to find a solution to extract the value from the atomic vector, could somebody help me with this?

Thanks a lot!

Jack

        [[alternative HTML version deleted]]



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 Thu 10 Jan 2008 - 03:17:38 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 Thu 10 Jan 2008 - 04:30:05 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