Lapointe, Pierre
2005-Jun-08 13:42 UTC
[R] RODBC question: problem importing series with blank cells
Hello, I have an excel file that I load through RODBC. Some of my columns are blank. They are equity time series and the stocks did not exist at the earlier dates. My problem is that the whole column becomes <NA> even though there are numbers at later dates. Here's my excel file http://www.tradebit.com/download.php/35699 <http://www.tradebit.com/download.php/35699> And here's the code I use: library(RODBC) chan <- odbcConnectExcel("C:/book54.xls") #load data ts<- sqlFetch(chan, "Sheet1") close(chan) ts<-ts[-1,] str(ts) head(ts) tail(ts) Regards, Pierre Lapointe Assistant Market Strategist National Bank Financial *********************************************************************************** AVIS DE NON-RESPONSABILITE:\ Ce document transmis par courri...{{dropped}}
Prof Brian Ripley
2005-Jun-08 14:06 UTC
[R] RODBC question: problem importing series with blank cells
On Wed, 8 Jun 2005, Lapointe, Pierre wrote:> Hello, > > I have an excel file that I load through RODBC. Some of my columns are > blank. They are equity time series and the stocks did not exist at the > earlier dates. My problem is that the whole column becomes <NA> even though > there are numbers at later dates.My Excel ODBC driver is sending NULLs for those rows, so I think this is an ODBC driver problem.> > Here's my excel file > > http://www.tradebit.com/download.php/35699 > <http://www.tradebit.com/download.php/35699> > > And here's the code I use: > > library(RODBC) > chan <- odbcConnectExcel("C:/book54.xls") #load data > ts<- sqlFetch(chan, "Sheet1") > close(chan) > ts<-ts[-1,] > > str(ts) > head(ts) > tail(ts) > > > > Regards, > > Pierre Lapointe > Assistant Market Strategist > National Bank Financial > > > *********************************************************************************** > AVIS DE NON-RESPONSABILITE:\ Ce document transmis par courri...{{dropped}} > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595