> * David Winsemius [2011-02-16 13:33:32 -0500]:
>
>> parse.num <- function (s) {
>> as.numeric(gsub("M$","e6",gsub("B$","e9",s))); }
>
> data[1] <- parse.num( data[[1]] ) # as.numeric and gsub are vectorized
because parse.num turned out to not be as simple as that: I need to
handle "N/A" specia
2011 9:01 PM
To: s...@gnu.org; r-h...@stat.math.ethz.ch
Subject: Re: [R] string parsing
> To: r-h...@stat.math.ethz.ch
> From: s...@gnu.org
> Date: Tue, 15 Feb 2011 17:20:11 -0500
> Subject: [R] string parsing
>
> I am trying to get s
On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote:
> I am trying to get stock metadata from Yahoo finance (or maybe there is
> a better source?)
> here is what I did so far:
>
> yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s=";;
> stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY"
On Feb 16, 2011, at 2:26 PM, David Winsemius wrote:
On Feb 16, 2011, at 2:09 PM, Sam Steingold wrote:
* David Winsemius [2011-02-16 13:33:32
-0500]:
parse.num <- function (s) {
as.numeric(gsub("M$","e6",gsub("B$","e9",s))); }
data[1] <- parse.num( data[[1]] ) # as.numeric and gsub ar
On Feb 16, 2011, at 2:09 PM, Sam Steingold wrote:
* David Winsemius [2011-02-16 13:33:32
-0500]:
parse.num <- function (s) {
as.numeric(gsub("M$","e6",gsub("B$","e9",s))); }
data[1] <- parse.num( data[[1]] ) # as.numeric and gsub are
vectorized
because parse.num turned out to not be
On Feb 15, 2011, at 5:20 PM, Sam Steingold wrote:
I am trying to get stock metadata from Yahoo finance (or maybe there
is
a better source?)
here is what I did so far:
yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s=";;
stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY","F"); # j
try this:
> x <- c('15.5B', '13.6M')
> x <- sub("B", 'e9', x)
> x <- sub("M", 'e6', x)
> as.numeric(x)
[1] 1551360
On Tue, Feb 15, 2011 at 5:20 PM, Sam Steingold wrote:
> I am trying to get stock metadata from Yahoo finance (or maybe there is
> a better source?)
> here is what I
> To: r-h...@stat.math.ethz.ch
> From: s...@gnu.org
> Date: Tue, 15 Feb 2011 17:20:11 -0500
> Subject: [R] string parsing
>
> I am trying to get stock metadata from Yahoo finance (or maybe there is
> a better source?)
search th
I am trying to get stock metadata from Yahoo finance (or maybe there is
a better source?)
here is what I did so far:
yahoo.url <- "http://finance.yahoo.com/d/quotes.csv?f=j1jka2&s=";;
stocks <- c("IBM","NOIZ","MSFT","LNN","C","BODY","F"); # just some samples
socket <- url(paste(yahoo.url,sep="",pa
9 matches
Mail list logo