Skip to content

Interactive workflow #25

@jacobbien

Description

@jacobbien

Currently if one pressed "Run all" in RStudio, one gets an error because usethis expects itself to be called from a package directory, but create-mypkg.Rmd lives in mypkg-project. One gets the error in the usethis::create_package() call and also in calls to usethis::use_package().

It'd be nice if "Run all" would work in Rstudio. Or if there's a simple alternative, e.g., a function like litr::load_all("create-mypkg.Rmd") that would load the current code into the console. At this point, I can think of two approaches for implementing litr::load_all():

  1. It calls litr::render() and then devtools::load_all("mypkg/"). I don't love this approach because litr::render() can be slow and I'm hoping for something more immediate.
  2. Use mockery to replace all usethis functions with stubs that don't do anything. I believe this should work but it might have some side-effects that I'm not thinking of.

It's also worth looking into what happens when one clicks "Run all" to see if one can do something like approach 2 before running all blocks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions