{"action":"closed","issue":{"url":"https://api.github.com/repos/ropensci/drake/issues/249","repository_url":"https://api.github.com/repos/ropensci/drake","labels_url":"https://api.github.com/repos/ropensci/drake/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/ropensci/drake/issues/249/comments","events_url":"https://api.github.com/repos/ropensci/drake/issues/249/events","html_url":"https://github.com/ropensci/drake/issues/249","id":296048038,"number":249,"title":"Writing file targets using here()","user":{"login":"tiernanmartin","id":8197328,"avatar_url":"https://avatars1.githubusercontent.com/u/8197328?v=4","gravatar_id":"","url":"https://api.github.com/users/tiernanmartin","html_url":"https://github.com/tiernanmartin","followers_url":"https://api.github.com/users/tiernanmartin/followers","following_url":"https://api.github.com/users/tiernanmartin/following{/other_user}","gists_url":"https://api.github.com/users/tiernanmartin/gists{/gist_id}","starred_url":"https://api.github.com/users/tiernanmartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiernanmartin/subscriptions","organizations_url":"https://api.github.com/users/tiernanmartin/orgs","repos_url":"https://api.github.com/users/tiernanmartin/repos","events_url":"https://api.github.com/users/tiernanmartin/events{/privacy}","received_events_url":"https://api.github.com/users/tiernanmartin/received_events","type":"User","site_admin":false},"labels":[{"id":543987607,"url":"https://api.github.com/repos/ropensci/drake/labels/bug","name":"bug","color":"ee0701","default":true},{"id":664568543,"url":"https://api.github.com/repos/ropensci/drake/labels/easy","name":"easy","color":"c2e0c6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-09T23:52:21Z","updated_at":"2018-02-10T03:52:27Z","closed_at":"2018-02-10T03:52:27Z","author_association":"NONE","body":"[`here::here()`](https://github.com/krlmlr/here/) is really useful for standardizing filepath roots within a project, but I'm not sure the best way to incorporate it into my drake plan.\r\n\r\nHere's an example that works, albeit with a warning:\r\n\r\n``` r\r\nlibrary(drake)\r\nlibrary(here)\r\nlibrary(tidyverse) \r\n\r\nhere()\r\n## [1] \"file/path/from/root/directory\" <- Note: this is output will be different for every system\r\n\r\ndrake_here <- function(x) {\r\n  x %>% str_replace_all(\"'\", \"\") %>% here() %>% as_drake_filename()\r\n}\r\n\r\nplan <- drake_plan(\r\n  'tmp/mtcars.csv' = write_csv(mtcars, here(\"tmp/mtcars.csv\")),\r\n  file_targets = TRUE,\r\n  strings_in_dots = \"literals\"\r\n) %>% purrr::modify_at(\"target\", drake_here)\r\n\r\nmake(plan)\r\n\r\n```\r\n\r\nHere's the warning I'm seeing:\r\n\r\n``` r\r\n## Warning message:\r\n## Possibly bad target names:\r\n##  file/path/from/root/directory/tmp/mtcars.csv   \r\n```\r\n\r\nDoes this approach seem like a good one or would you recommend something else?"}}
{"actor":{"display_login":"wlandau"}}