[R] how can I import op.gz files with read.csv or otherwise

2012-12-21 Thread herr dittmann
Dear R-users, I am struggling to directly read an "op.gz" file into R. NOAA kindly provides daily weather data on their FTP server for download. > sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=

[R] problem with looping formula through table

2011-03-13 Thread herr dittmann
Dear useRs, I am stuck with a piece of code and hope you could give me some pointers. My aim is to calculate the lm-regression coefficients of individual stocks against an index. I am interested in both the coefficient and the pval. While I could do this manually for a select hand full, I hope

[R] rollapply - odd behaviour of NAs

2010-03-01 Thread herr dittmann
Dear expeRts, The rollapply(tseries) function puzzles me. When applying a function over a rolling window, I am getting NAs at odd places: dow <- get.hist.quote(instrument="^DJI", start="2010-02-01", quote="Close") dow.2 <- rollapply(dow, width=2, FUN=mean) dow.3 <- rollapply(dow, width=3, FUN=me