{"action":"created","issue":{"url":"https://api.github.com/repos/NREL/rplexos/issues/12","labels_url":"https://api.github.com/repos/NREL/rplexos/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/NREL/rplexos/issues/12/comments","events_url":"https://api.github.com/repos/NREL/rplexos/issues/12/events","html_url":"https://github.com/NREL/rplexos/issues/12","id":55728820,"number":12,"title":"Time.range documentation","user":{"login":"takje","id":6696142,"avatar_url":"https://avatars.githubusercontent.com/u/6696142?v=3","gravatar_id":"","url":"https://api.github.com/users/takje","html_url":"https://github.com/takje","followers_url":"https://api.github.com/users/takje/followers","following_url":"https://api.github.com/users/takje/following{/other_user}","gists_url":"https://api.github.com/users/takje/gists{/gist_id}","starred_url":"https://api.github.com/users/takje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takje/subscriptions","organizations_url":"https://api.github.com/users/takje/orgs","repos_url":"https://api.github.com/users/takje/repos","events_url":"https://api.github.com/users/takje/events{/privacy}","received_events_url":"https://api.github.com/users/takje/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NREL/rplexos/labels/question","name":"question","color":"f7c6c7"}],"state":"closed","locked":false,"assignee":{"login":"eibanez","id":438494,"avatar_url":"https://avatars.githubusercontent.com/u/438494?v=3","gravatar_id":"","url":"https://api.github.com/users/eibanez","html_url":"https://github.com/eibanez","followers_url":"https://api.github.com/users/eibanez/followers","following_url":"https://api.github.com/users/eibanez/following{/other_user}","gists_url":"https://api.github.com/users/eibanez/gists{/gist_id}","starred_url":"https://api.github.com/users/eibanez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eibanez/subscriptions","organizations_url":"https://api.github.com/users/eibanez/orgs","repos_url":"https://api.github.com/users/eibanez/repos","events_url":"https://api.github.com/users/eibanez/events{/privacy}","received_events_url":"https://api.github.com/users/eibanez/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NREL/rplexos/milestones/1","labels_url":"https://api.github.com/repos/NREL/rplexos/milestones/1/labels","id":829536,"number":1,"title":"v1.0","description":"","creator":{"login":"eibanez","id":438494,"avatar_url":"https://avatars.githubusercontent.com/u/438494?v=3","gravatar_id":"","url":"https://api.github.com/users/eibanez","html_url":"https://github.com/eibanez","followers_url":"https://api.github.com/users/eibanez/followers","following_url":"https://api.github.com/users/eibanez/following{/other_user}","gists_url":"https://api.github.com/users/eibanez/gists{/gist_id}","starred_url":"https://api.github.com/users/eibanez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eibanez/subscriptions","organizations_url":"https://api.github.com/users/eibanez/orgs","repos_url":"https://api.github.com/users/eibanez/repos","events_url":"https://api.github.com/users/eibanez/events{/privacy}","received_events_url":"https://api.github.com/users/eibanez/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2014-10-16T21:46:00Z","updated_at":"2015-02-15T07:38:01Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-01-28T08:47:30Z","updated_at":"2015-02-16T06:50:03Z","closed_at":"2015-02-09T14:11:17Z","body":"When using large databases, it is difficult to get them in the memory as a whole. Therefore, I would like to subset my Plexos solution using rplexos. However, I can't get the most important subset item, time.range, to work.\r\n\r\nOn my own db, I tried the following command:\r\n`PASA <- query_interval(db,\"Generator\",c(\"Installed Capacity\"),phase=2, time.range=c('2014-01-01 0:00:00','2014-12-31 00:00:00'))`\r\n\r\nHowever, I get the error:\r\n`Error in UseMethod(\"escape\") : \r\n  no applicable method for 'escape' applied to an object of class \"c('POSIXct', 'POSIXt')\"`\r\n\r\nI tried some variations such as: `time.range=c('2014-01-01','2014-12-31')` OR `time.range=c('20140101','20141231')`, however the error keeps coming back.\r\n\r\nThe traceback looks like this:\r\n```\r\n    46: escape(val, con = con)\r\n    45: FUN(X[[3L]], ...)\r\n    44: vapply(dots(...), escape_expr, character(1))\r\n    43: build_sql(x, \" BETWEEN \", left, \" AND \", right)\r\n    42: between(time, 1388534400, 1419984000)\r\n    41: eval(expr, envir, enclos)\r\n    40: eval(x, envir = env)\r\n    39: FUN(X[[2L]], ...)\r\n    38: lapply(expr, function(x) {\r\n            if (is.atomic(x)) \r\n                return(escape(x, con = con))\r\n            env <- sql_env(x, variant, con, window = window)\r\n            eval(x, envir = env)\r\n        })\r\n    37: translate_sql_q(expr, tbl = x, env = NULL, ...)\r\n    36: translate(x$where)\r\n    35: build_query(object)\r\n    34: update.tbl_sql(.data, where = c(.data$where, input))\r\n    33: update(.data, where = c(.data$where, input))\r\n    32: update(.data, where = c(.data$where, input))\r\n    31: filter_.tbl_sql(.data, .dots = lazyeval::lazy_dots(...))\r\n    30: filter_(.data, .dots = lazyeval::lazy_dots(...))\r\n    29: filter(., between(time, time.r.min, time.r.max))\r\n    28: function_list[[k]](value)\r\n    27: withVisible(function_list[[k]](value))\r\n    26: freduce(value, `_function_list`)\r\n    25: `_fseq`(`_lhs`)\r\n    24: eval(expr, envir, enclos)\r\n    23: eval(quote(`_fseq`(`_lhs`)), env, env)\r\n    22: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))\r\n    21: time.data %>% filter(between(time, time.r.min, time.r.max))\r\n    20: query_master_each(x$db, ...)\r\n    19: safe_query(., time, .$collection, .$property, new$columns, new$time.range, \r\n            filter, phase)\r\n    18: eval(expr, envir, enclos)\r\n    17: eval(args[[j]]$expr, envir = env)\r\n    16: do_.rowwise_df(.data, .dots = lazyeval::lazy_dots(...))\r\n    15: do_(.data, .dots = lazyeval::lazy_dots(...))\r\n    14: do(., safe_query(., time, .$collection, .$property, new$columns, \r\n            new$time.range, filter, phase))\r\n    13: function_list[[k]](value)\r\n    12: withVisible(function_list[[k]](value))\r\n    11: freduce(value, `_function_list`)\r\n    10: `_fseq`(`_lhs`)\r\n    9: eval(expr, envir, enclos)\r\n    8: eval(quote(`_fseq`(`_lhs`)), env, env)\r\n    7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))\r\n    6: db.prop %>% rowwise() %>% do(safe_query(., time, .$collection, \r\n           .$property, new$columns, new$time.range, filter, phase))\r\n    5: query_master(db, \"interval\", ...)\r\n    4: query_interval(db, \"Generator\", c(\"Installed Capacity\"), phase = Phase_id, \r\n           time.range = c(\"20140101\", \"20141231\"))\r\n    3: eval(expr, envir, enclos)\r\n    2: eval(lhs, parent, parent)\r\n    1: query_interval(db, \"Generator\", c(\"Installed Capacity\"), phase = Phase_id, \r\n           time.range = c(\"20140101\", \"20141231\"))\r\n```\r\n\r\nThe problem is that since my db spans many years, it has not enough memory to load all the years. Am I using the time.range feature wrong? In that case could you add a working example of time.range?\r\n\r\nBtw, wonderful package! It's really helpful that you put your time and effort in developing this."},"comment":{"url":"https://api.github.com/repos/NREL/rplexos/issues/comments/74466364","html_url":"https://github.com/NREL/rplexos/issues/12#issuecomment-74466364","issue_url":"https://api.github.com/repos/NREL/rplexos/issues/12","id":74466364,"user":{"login":"eibanez","id":438494,"avatar_url":"https://avatars.githubusercontent.com/u/438494?v=3","gravatar_id":"","url":"https://api.github.com/users/eibanez","html_url":"https://github.com/eibanez","followers_url":"https://api.github.com/users/eibanez/followers","following_url":"https://api.github.com/users/eibanez/following{/other_user}","gists_url":"https://api.github.com/users/eibanez/gists{/gist_id}","starred_url":"https://api.github.com/users/eibanez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eibanez/subscriptions","organizations_url":"https://api.github.com/users/eibanez/orgs","repos_url":"https://api.github.com/users/eibanez/repos","events_url":"https://api.github.com/users/eibanez/events{/privacy}","received_events_url":"https://api.github.com/users/eibanez/received_events","type":"User","site_admin":false},"created_at":"2015-02-16T06:50:03Z","updated_at":"2015-02-16T06:50:03Z","body":"@takje Could you try if the newest version works for you? I'd like to get this working before the next CRAN submission. You can download the latest binary using the following commands:\r\n\r\n```\r\ndownload.file(\"http://ci.appveyor.com/api/buildjobs/tootmnh92b5yg4v8/artifacts/rplexos_0.12.1.99.zip\", \"rplexos_0.12.1.99.zip\")\r\ninstall.packages(\"rplexos_0.12.1.99.zip\")\r\n```"}}