Skip to content

alternative to path_package() #1105

Description

@sbgraves237

In my new package "github.com/sbgraves237/SS4Maddison", I want to store raw data file in my local environment and use it in a vignette when available and skip processing it when it's not available. My current solution starts with putting it in "inst/extdata" on my local computer and listing it in "inst/extdata/.gitignore". Then I wrote "path_package2" inspired by the description of "fs::path_package()" in section 7.3.1 Filepaths of R Packages. My "path_package2" returns a character vector of full.names of all files found with an attribute "searched" giving the full.names of all directories searched: If the character vector is of length 0, I can skip the parts of the vignette requiring that data file. It seems to work as desired regardless of which state the package is in. And the vignette source could be copied out of the package into another directory with the the desired data file somewhere close, and "path_package2" could find it if it's enough in some appropriate sense.

What do you think?

Please feel free to "path_package2" or the ideas behind it if they appeal to you. Spencer Graves (sbgraves237).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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