Wasabi
Wasabi

Reputation: 3061

Installing custom package which depends on other custom package

I have a utilities package foo, and have developed another package bar which calls functions in foo.

foo is available on a URL (not Github or any such service) as source files. I install/update it using

install.packages("//mywebsite.com/foo",
                 repos = NULL,
                 type = "source")

I now want to share bar with others. I've read the devtools page on dependencies and understand I merely have to add a Remotes section to my DESCRIPTION file.

However, the example for a URL-based remote dependency is:

# URL
Remotes: url::https://github.com/hadley/stringr/archive/master.zip

What concerns me here is that the example uses a .zip file, but the package foo is only available as a raw source directory.

Will this work? Can I simply use

Remotes: url:://mywebsite.com/foo

Or does this only work with zipped files?

I notice the following example, for local packages, does not have an extension (Remotes: local::/pkgs/testthat), which makes me hopeful it's representing a source directory and that therefore that'll also work for URLs, but am not sure.

Upvotes: 1

Views: 155

Answers (1)

tfehring
tfehring

Reputation: 394

It looks like remotes::install_url requires a .zip, .tar, or .tar.gz, and that's likely what would be called to install the dependency if you specify Remotes: url:://mywebsite.com/foo.

If your code is in a Git repo (even if not on GitHub/GitLab) you can refer directly to the repo. Or if it's on a network drive you can refer to it using local instead of url, since remotes::install_local can handle directories.

Upvotes: 1

Related Questions