Helper function for retrieving and settings the user's custom R_CONFIG_DIR.
Details
This function appends path elements to your default R_CONFIG_DIR. To find
R_CONFIG_DIR it will first attempt to search for the R_CONFIG_DIR environment
variable, and if unset defaults to ~/.config/R on all operating systems
(i.e. %USERPROFILE%\.config\R on Windows).
Examples
library(configR)
# retrieve path to .Rprofile (i.e. ~/.config/R/.Rprofile)
r_config_dir(".Rprofile")
#> Warning: path[1]="/home/runner/.config/R": No such file or directory
#> Warning: path[1]="/home/runner/.config/R/.Rprofile": No such file or directory
#> [1] "/home/runner/.config/R/.Rprofile"
# retrieve path to your "profile" configuration directory
# (i.e. ~/.config/R/profile)
r_config_dir("profile")
#> Warning: path[1]="/home/runner/.config/R": No such file or directory
#> Warning: path[1]="/home/runner/.config/R/profile": No such file or directory
#> [1] "/home/runner/.config/R/profile"