Summary
rFVS cannot be installed from GitHub the usual way:
remotes::install_github("USDAForestService/ForestVegetationSimulator-Interface", subdir = "rFVS")
This fails because the package has no NAMESPACE file. .gitignore excludes it, along with the generated help pages:
fvsOL/NAMESPACE
rFVS/NAMESPACE
fvsOL/man/*
rFVS/man/*
R has required a NAMESPACE since R 3.0.0, and remotes::install_github() runs R CMD build before R CMD INSTALL, so the install stops before it starts.
Why it matters
There are currently no installation instructions for rFVS or fvsOL in this repo.
Users who want to install rFVS are forced through a workaround such as: clone the repo, install devtools and roxygen2, run devtools::document() to regenerate what the repo already knows how to generate, and then install the package.
Concretely, that is what I've been doing in a Docker container as part of a build for the FVS GUI:
RUN Rscript -e 'install.packages(c("devtools", "roxygen2"))' \
&& git clone --depth 1 https://github.com/USDAForestService/ForestVegetationSimulator-Interface /tmp/interface \
&& Rscript -e 'devtools::document("/tmp/interface/rFVS"); \
devtools::install("/tmp/interface/rFVS", dependencies = FALSE, upgrade = FALSE)'
That could be replaced with a single line. It also means the installed package depends on whichever roxygen2 version I happen to be using, rather than on a NAMESPACE rFVS and fvsOL maintainers reviewed.
rFVS is otherwise incredibly easy to depend on -- Depends: R (>= 4.0.0) and nothing else -- which makes the packaging friction the single obstacle to using it as a plain R dependency.
Suggested fix
Commit the generated roxygen output. This is standard practice for R packages distributed via GitHub and it is what install_github() assumes.
-
Remove these four lines from .gitignore:
fvsOL/NAMESPACE
rFVS/NAMESPACE
fvsOL/man/*
rFVS/man/*
-
Run the existing rFVS/makefile target (or devtools::document("rFVS")) and commit the resulting rFVS/NAMESPACE and rFVS/man/. All 23 files in rFVS/R/ already carry @export, so the generated NAMESPACE is complete -- nothing needs to be hand-written.
-
Do the same for fvsOL to allow it to be installable in the same way.
If regenerating by hand at release time is a concern, a GitHub Action running roxygen2::roxygenise() and committing the result on push keeps the files current without adding a manual step.
Smaller things, if you are touching the packaging anyway
rFVS/tests/ holds iet01.key and iet01.tre. These mirror the engine repo's fixture tests/FVSie/iet01.{key,tre} -- one of the <variant>t01 cases it keeps per variant -- with the tree records reordered and the key file's DataBase/DSNOut output block removed, which makes sense for a run driven through the rFVS API. Unlike the engine's copies, though, these have no .save expected-output file, no driver script and no makefile target, and nothing referencing them anywhere in this repo. I cannot tell whether they are meant as a regression fixture or as example input. Either way the packaging consequence is the same: tests/ is not installed, so they are dropped at install time and a user cannot reach them via system.file(), while R CMD check finds nothing in tests/ to run. If they are meant as a regression check, a small tests/*.R driver plus an expected-output file would let R CMD check run it on every build; if they are meant as example input, inst/extdata/ would ship them with the installed package and let the man/ examples point at them.
rFVS/makefile and rFVS/rFVSmadeTag would be included in a built tarball; a two-line .Rbuildignore would exclude them.
Verification
With the proposed change, this should succeed on a clean machine:
remotes::install_github("USDAForestService/ForestVegetationSimulator-Interface", subdir = "rFVS")
library(rFVS)
fvsLoad("FVSpn", bin = "/path/to/FVSbin")
Summary
rFVScannot be installed from GitHub the usual way:This fails because the package has no
NAMESPACEfile..gitignoreexcludes it, along with the generated help pages:R has required a
NAMESPACEsince R 3.0.0, andremotes::install_github()runsR CMD buildbeforeR CMD INSTALL, so the install stops before it starts.Why it matters
There are currently no installation instructions for rFVS or fvsOL in this repo.
Users who want to install
rFVSare forced through a workaround such as: clone the repo, installdevtoolsandroxygen2, rundevtools::document()to regenerate what the repo already knows how to generate, and then install the package.Concretely, that is what I've been doing in a Docker container as part of a build for the FVS GUI:
That could be replaced with a single line. It also means the installed package depends on whichever roxygen2 version I happen to be using, rather than on a
NAMESPACErFVS and fvsOL maintainers reviewed.rFVSis otherwise incredibly easy to depend on --Depends: R (>= 4.0.0)and nothing else -- which makes the packaging friction the single obstacle to using it as a plain R dependency.Suggested fix
Commit the generated roxygen output. This is standard practice for R packages distributed via GitHub and it is what
install_github()assumes.Remove these four lines from
.gitignore:Run the existing
rFVS/makefiletarget (ordevtools::document("rFVS")) and commit the resultingrFVS/NAMESPACEandrFVS/man/. All 23 files inrFVS/R/already carry@export, so the generatedNAMESPACEis complete -- nothing needs to be hand-written.Do the same for
fvsOLto allow it to be installable in the same way.If regenerating by hand at release time is a concern, a GitHub Action running
roxygen2::roxygenise()and committing the result on push keeps the files current without adding a manual step.Smaller things, if you are touching the packaging anyway
rFVS/tests/holdsiet01.keyandiet01.tre. These mirror the engine repo's fixturetests/FVSie/iet01.{key,tre}-- one of the<variant>t01cases it keeps per variant -- with the tree records reordered and the key file'sDataBase/DSNOutoutput block removed, which makes sense for a run driven through the rFVS API. Unlike the engine's copies, though, these have no.saveexpected-output file, no driver script and no makefile target, and nothing referencing them anywhere in this repo. I cannot tell whether they are meant as a regression fixture or as example input. Either way the packaging consequence is the same:tests/is not installed, so they are dropped at install time and a user cannot reach them viasystem.file(), whileR CMD checkfinds nothing intests/to run. If they are meant as a regression check, a smalltests/*.Rdriver plus an expected-output file would letR CMD checkrun it on every build; if they are meant as example input,inst/extdata/would ship them with the installed package and let theman/examples point at them.rFVS/makefileandrFVS/rFVSmadeTagwould be included in a built tarball; a two-line.Rbuildignorewould exclude them.Verification
With the proposed change, this should succeed on a clean machine: