This is an R package that provides Rmarkdown templates and various practical functions for R users in NINA. NINA-employees, please contribute with R functions that you think would be useful to others.
Currently, the package contains the functions:
- addAlpha
- addLogo
- add_logo
- checkWorkload
- grassConnect
- grassDailyPrecip
- grassDailyTemp
- grassMonthlyPrecip
- grassMonthlyTemp
- grassViewshed
- jensAnalysis
- mountFolders
- ninaBeamer
- ninaColors
- ninaLogoPalette
- ninaPalette
- ninaRapport
- ninaSlidy
- nina_colors
- postgreSQLConnect
- scale_color_nina
- scale_fill_nina
- tidyScandinavian
Some grass functions might not work.
The templates are superseeded by the new quarto_templates, see e.g. https://github.com/NINAnor/quarto_nina_report. The old ones will be removed from this package.
Install from github.
devtools::install_github("NINAnor/NinaR")
To enable a simple vignette of current graphic functions (and install the suggested knitr package), do instead:
devtools::install_github("NINAnor/NinaR", build_vignettes = TRUE)
vignette("Nina-figures")
Alternatively, it might be a good idea not to use the network drive to store your R-packages. To switch to using a local folder, create a folder on C:/, for example C:/R-packages. Then let R know where you want to put your packages by going to Control panel -> User accounts -> Change my environment variables, and make or update the environmental variable “R_LIBS_USER” to say C:/R-packages. After a restart, R should now use this folder for package installation. This might solve installation issues with other packages as well.
To list all the available documentation:
help(package="NinaR")
Once installed and using Rstudio, Nina templates appear in the
New file>Rmarkdown
menu. Alternatively, they could be retreived by
rmarkdown::draft("title", template="nina_slidy", package="NinaR")
#and
rmarkdown::draft("title", template="nina_rapport", package="NinaR")
For further use, see the package rmarkdown, rticles or the templates themselves.
Questions and suggestions can be added on this site (issues) or to Jens Åström (jens.astrom)