search for: 19e6

Displaying 1 result from an estimated 1 matches for "19e6".

Did you mean: 1996
2011 Feb 15
4
string parsing
...5B 116.00 166.25 4965150 2 19.1M 3.75 5.47 8521 3 226.6B 22.73 31.58 57127000 4 886.4M 30.80 74.54 226690 5 142.4B 3.21 5.15 541804992 6 276.4M 11.98 21.30 149656 7 55.823B 9.75 18.97 89369000 now I need to do this: --> convert 55.823B to 55e9 and 19.1M to 19e6 parse.num <- function (s) { as.numeric(gsub("M$","e6",gsub("B$","e9",s))); } data[1]<-lapply(data[1],parse.num); seems like awfully inefficient (two regexp substitutions), is there a better way? --> iterate over stocks & data at the same time...