richfitz / remake

Make-like declarative workflows in R
Other
340 stars 32 forks source link

`package::function` syntax in `command` #170

Closed ashiklom closed 7 years ago

ashiklom commented 7 years ago

It would be nice to be able to use package::function syntax in commands. Currently, this fails, I'm guessing because the yaml parser is confused by the colons.

Example:

This works fine...

packages:
    - readr

targets:
    all: 
        depends: myiris

    iris.csv:
        command: write.csv(I(iris), I('iris.csv'), row.names = FALSE)

    myiris:
        command: read_csv('iris.csv')

...but if I swap out the last line with command: readr::read_csv('iris.csv'), it fails with the following error:

Error in check_command_rule(command[[1]]) :
  While processing target 'myiris':
    Rule must be a character or name
Calls: <Anonymous> ... parse_target_command -> parse_command -> check_command_rule
Execution halted
wlandau commented 7 years ago

@ashiklom Agreed. You may want to look at the thread at #119 and the mention at #124.

ashiklom commented 7 years ago

Whoops! I somehow missed those when looking through the issues. In that case, this can be closed as a duplicate of #119.

krlmlr commented 7 years ago

Closing as duplicate.