-
Notifications
You must be signed in to change notification settings - Fork 0
Home
It is recommended to use renv
to easily manage the package dependency. To install renv
, run the following command in your R console:
install.packages("renv")
You can then check the installation by running:
renv::status()
The functionalities of laggedcor
depend on multiple other packages to work correctly. To install them easily using renv,
simply run the following command in your R console:
renv::restore()
It will create a project-specific environment by downloading the necessary packages if not installed, and only loading (linking)_ the necessary packages if installed (kind of like conda
's environment, but not 100% the same, as it does not manage the R version).
renv
only resolves the packages required for the successful compilation and execution of laggedcor
. To develop a R package, you need to manually install the following packages:
install.packages(c("devtools", "roxygen2", "testthat", "knitr"))
# or using renv 👇
renv::install(c("devtools", "roxygen2", "testthat", "knitr"))
After installation, you can have a look at the "(package) development situation report", to both verify the successful installation and check your development environment.
devtools::dev_sitrep()
It is recommended to use the GUI in R studio to perform test build, building and testing (but you can also type the corresponding commands in your R console).
Navigate to the build tab in the upper right panel:
As you can see, there are four buttons in the top menu: Install, Test, Check and More. The functionality of those buttons are :
-
Install: install the package to your current local environment. After installing, you can use
library(laggedcor)
in other files (for example, running.Rmd
files invignettes
), just like other packages - Test: run all available tests available. To run individual tests, one can open the corresponding test file and click the Run Test button on the top right corner of the upper left panel.
- Check: it basically checks whether the package can be built properly and run tests.
You can optionally make renv
automatically load the project local functions in current and all future R sessions by activating the project:
renv::activate()
(WIP)