[R] Color cells of a matrix as in Excel

2012-02-14 Thread John Nicholas
All, I frequently make spreadsheets in Excel in which I rank values in columns by stop-light colors (red is bad, yellow is OK, green is good). Image and heatmap expect a matrix in which all the data are in the same scale, but I frequently have different scales in different columns. ie. Column one

[R] Picking returns from particular days of the month from a zoo object

2011-07-23 Thread john nicholas
Hello, I would like to implement a "turn-of-the-month' trading strategy in R. Given a daily series of stock market return data as a zoo object, the strategy would go long (buy) four trading days before the end of the month, and sell the third trading day of the following month. How can I sel

[R] Basic Help with Zoo objects and trading days

2011-01-29 Thread john nicholas
All, I have been just recently working with zoo objects for trading systems. Can someone please help with these basic questions? Given a daily time series downloaded using get.hist.quote() from the tseries package, ie.. startDate= as.Date("2000-01-01") endDate= as.Date("2011-01-29") freque