-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error running README examples #50
Comments
Thank you for reporting the error. README.md is now based on README.Rmd to make sure that the code inside runs without errors. nc.shp from Thank you for your help! |
You could put the example data in the For example, the sf example data you are calling is located here: https://github.com/r-spatial/sf/tree/main/inst/shape and loaded with the command you have in the example: Taking a similar approach for example data would prevent problems with downloading a file from the internet being required to run any examples. I'd also suggest to remove the code about installing required packages for the readme example. If the README requires packages that are not installed with the package as dependencies, you can include them as suggested dependencies that will get installed. Or you could use |
The example data were not included in the package intentionally to reduce the file size of the built package (./tests/testdata folder is ~25 MB). Thank you for letting me know I agree on making README succinct by removing boilerplate codes. Do you think the latest push includes boilerplate codes? Thank you! |
Just my two cents, but You could host the data somewhere else if you don't want to include it in the package, but right now the README wouldn't be run-able without someone cloning the package to their computer. A workaround might be to host the data with the github release of the package as an asset. |
To make the README.md runnable, I will include the datasets used in README in |
srtm <- terra::unwrap(readRDS("../../tests/testdata/nc_srtm15_otm.rds"))
fails for me because I think the code is intended to work only if run from the development version of the package.We could use a
system.file()
call like you did with the example sf data to get that to work (although tests are not installed by default if using the “testthat” package for tests; you might have to include this example in the package itself)Using a
README.Rmd
to knit aREADME
file would be a good way to include these in the CI process.The text was updated successfully, but these errors were encountered: