Package 'configR'

Title: R Conviguration Package
Description: Setup and configure an optimal R development environment.
Authors: Jimmy Briggs [aut, cre]
Maintainer: Jimmy Briggs <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-02-15 03:39:09 UTC
Source: https://github.com/jimbrig/configR

Help Index


Install pak

Description

Installs the pak R package by r-lib from their official binary GitHub build.

Usage

inst_pak()

Details

Note this installs the development version of r-lib/pak using the following code:

repo <- sprintf(
  "https://r-lib.github.io/p/pak/stable/%s/%s/%s",
  .Platform$pkgType,
  R.Version()$os,
  R.Version()$arch
)

install.packages("pak", repos = repo)

Value

Invisible NULL

See Also

Examples

## Not run: 
inst_pak()

## End(Not run)

r_config_dir

Description

Helper function for retrieving and settings the user's custom R_CONFIG_DIR.

Usage

r_config_dir(...)

Arguments

...

Path elements passed as character strings to append to 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).

Value

normalized path to the R_CONFIG_DIR

Examples

library(configR)

# retrieve path to .Rprofile (i.e. ~/.config/R/.Rprofile)
r_config_dir(".Rprofile")

# retrieve path to your "profile" configuration directory
# (i.e. ~/.config/R/profile)
r_config_dir("profile")

rver

Description

Helper function to return your system's installed R version in a variety of commonly used formats.

See the format parameter for available options.

Usage

rver(format = c("full", "text", "lib", "major", "minor", "nickname"))

Arguments

format

Character string of one of the following: full, text, lib, major, minor, nickname. See details for specifics.

Details

The following formatted return values can be specified with the format argument:

  • full: returns the full ⁠{major}.{minor}.{patch}⁠ semantic version of R.

  • text: returns the version string of R in the format "R version ⁠{major}.{minor}.{patch} ({date} {crt})⁠".

  • lib: returns ⁠{major}.{minor}⁠ R version string; useful for your .libPaths().

  • major: returns only the major R version.

  • minor: returns only the minor R version.

  • nickname: returns the R version's nickname (i.e. the value listed on startup).

Value

character string in specified format

Examples

library(configR)

# get full R version
rver()

# get path the default library path
r_config_dir("lib", rver("lib"))

# get full text string of R version details
rver("text")