Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread Jeff Newmiller
Since RExcel imports date/time columns as POSIXt, sticking with that is probably simpler in this case. The key I have found that makes the use of POSIXt types relatively straightforward is to set the TZ environment variable using Sys.setenv() to a value that is compatible with the timezone of t

Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread R. Michael Weylandt
Honestly, given what a pain dates are in Excel, I might simply import them as strings and do the conversion on the R side of things. Also, I'd recommend you use Date objects rather than POSIXct to cut out the unnecessary complexity of timezones, DST, etc. [See Gabor's article in RNews 4/1 for a ful

Re: [R] Divide all rows of a data frame by the first row.

2012-06-15 Thread Keith Weintraub
Jeff, Thanks. I was able to easily get rid of the do.call code and use the t( t(...)) construct. In terms of the dates I have tried your suggestion and I am having an odd problem. The dates I included in my previous message were only a subset of the actual dates I am using. My dates were im

Re: [R] Divide all rows of a data frame by the first row.

2012-06-14 Thread Jeff Newmiller
a) Avoid mixing Date objects and POSIXt objects. The timezones will mess you up in the conversions. Just eliminate the as.Date conversion entirely. b) By the time you reach the do.call function call, amortsByYears is a matrix. While a data.frame is a special kind of list, a matrix is not. Hence,