Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upas.zoo(dataframe, order.by=dates) breaks after loading quantmod #168
Comments
|
Thanks for the report! I can replicate this, and will investigate. |
|
Well, this is a history lesson. The error is because the quantmod method has a > git diff R/quantmod.R
diff --git a/R/quantmod.R b/R/quantmod.R
index 93dbc7f..11c21ca 100644
--- a/R/quantmod.R
+++ b/R/quantmod.R
@@ -12,8 +12,12 @@ function(x)
`as.zoo.data.frame`<-
function(x,row.date=TRUE,...)
{
+ # ignore row.date if order.by is specified
+ if(hasArg(order.by)) {
+ zoo(x,...)
+ }
#really need to test order - ???how?
- if(row.date) {
+ else if(row.date) {
zoo(x,as.Date(rownames(x),origin='1970-01-01'),...)
}
else { |
Description
The function call from the tile stops working after loading quantmod, see MWE
Expected behavior
No interference with as.zoo()
Minimal, reproducible example
Session Info