{"action":"opened","issue":{"url":"https://api.github.com/repos/joshuaulrich/xts/issues/62","labels_url":"https://api.github.com/repos/joshuaulrich/xts/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/joshuaulrich/xts/issues/62/comments","events_url":"https://api.github.com/repos/joshuaulrich/xts/issues/62/events","html_url":"https://github.com/joshuaulrich/xts/issues/62","id":59003231,"number":62,"title":"[R-Forge #5873] plot2.xts - addLines error","user":{"login":"joshuaulrich","id":1023193,"avatar_url":"https://avatars.githubusercontent.com/u/1023193?v=3","gravatar_id":"","url":"https://api.github.com/users/joshuaulrich","html_url":"https://github.com/joshuaulrich","followers_url":"https://api.github.com/users/joshuaulrich/followers","following_url":"https://api.github.com/users/joshuaulrich/following{/other_user}","gists_url":"https://api.github.com/users/joshuaulrich/gists{/gist_id}","starred_url":"https://api.github.com/users/joshuaulrich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshuaulrich/subscriptions","organizations_url":"https://api.github.com/users/joshuaulrich/orgs","repos_url":"https://api.github.com/users/joshuaulrich/repos","events_url":"https://api.github.com/users/joshuaulrich/events{/privacy}","received_events_url":"https://api.github.com/users/joshuaulrich/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joshuaulrich/xts/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-26T01:35:11Z","updated_at":"2015-02-26T01:35:11Z","closed_at":null,"body":"Submitted by: Peter Carl\r\nAssigned to: Nobody\r\n[R-Forge link](http://r-forge.r-project.org/tracker/index.php?func=detail&aid=5873&group_id=118&atid=516)\r\n\n> plot2_xts(CumReturns(R), theme=pccTheme, multi.panel=TRUE)\r\n> addLines(SMA(CumReturns(R[,1]), n=10), col='darkgray', on=1)\r\n Error in text.default(NROW(xdata[xsubset]) + 1/3, grid_lines(xdata, xsubset),  : \r\n  zero-length 'labels' specified \r\n\r\nHere's the traceback:\r\n\r\n10 text.default(NROW(xdata[xsubset]) + 1/3, grid_lines(xdata, xsubset), \r\n    noquote(format(grid_lines(xdata, xsubset), justify = 'right')), \r\n    col = theme$labels, offset = 0, pos = 4, cex = 0.9, xpd = TRUE) \r\n9 text(NROW(xdata[xsubset]) + 1/3, grid_lines(xdata, xsubset), \r\n    noquote(format(grid_lines(xdata, xsubset), justify = 'right')), \r\n    col = theme$labels, offset = 0, pos = 4, cex = 0.9, xpd = TRUE) \r\n8 eval(expr, envir, enclos) \r\n7 eval(aob, env) at replot_xts.R#243\r\n6 FUN(X[[13L]], ...) \r\n5 lapply(x$Env$actions, function(aob) {\r\n    if (attr(aob, 'frame') > 0) {\r\n        x$set_frame(attr(aob, 'frame'), attr(aob, 'clip'))\r\n        env <- attr(aob, 'env')\r\n        if (is.list(env)) {\r\n            env <- unlist(lapply(env, function(x) eapply(x, eval)), \r\n                recursive = FALSE)\r\n        }\r\n        eval(aob, env)\r\n    }\r\n}) at replot_xts.R#235\r\n4 plot.replot_xts(x, ...) \r\n3 plot(x, ...) at replot_xts.R#207\r\n2 print.replot_xts(<environment>) \r\n1 print(<environment>) \r\n\r\nDespite the error, the line is drawn correctly.\r\n\r\nIs there a better way to overlay a transformation of a line onto the line in a multi.panel series?  Maybe I haven't discovered it yet...\r\n\r\npcc\r\n\nFollowups:\r\n\r\nDate: 2014-08-14 20:50\r\nSender: Peter Carl\r\nI now see that although the line is drawn correctly, there's no legend."}}