Skip to content
Prev 178560 / 398503 Next

Extract one element from yahooKeystats data

Using str(data) would have been more informative.

"data" it turns out is a dataframe with a single column. which is a  
factor with rownames. Not the most typical of constructions, but the  
authors must have had their reasons ....

data$Value[row.names(data)=="Float"]
# [1] 1.30B
# 52 Levels: -1.00% -11.40% -18.69% -38.03% 0.04% 0.78 06-Feb-09 09- 
Mar-09 ... NA

# ... or to get rid of those annoying factor levels...
as.character(data[row.names(data)=="Float", ] )
# [1] "1.30B"
On Apr 27, 2009, at 6:55 PM, David Winsemius wrote:

            
David Winsemius, MD
Heritage Laboratories
West Hartford, CT