Skip to content

let user decide whether to open R file created with use_r #817

@pr130

Description

@pr130

In use_test the user can specify the open argument to avoid opening the R files in the editor.
In use_r, this is not possible right now. I think for automation this would be a nice to have feature. Plus, it would increase consistency of the two functions that are quite similar.

    lapply(c("foo", "bar", "zett"), usethis::use_r) # opens windows in Rstudio
    lapply(c("foo", "bar", "zett"), usethis::use_test) # opens windows in Rstudio (because interactive()  is default)
    
    # don't open windows
    lapply(c("foo", "bar", "zett"), usethis::use_test, open = FALSE) # does not open windows
    lapply(c("foo", "bar", "zett"), usethis::use_r, open = FALSE) # <- open argument not availale -> error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions