Skip to content

rv init

rv init will initialize a new or existing project by:

  1. Setting up the project infrastructure, including the project library and activation scripts.
  2. Create configuration file which is populated with the R version and repositories
Terminal window
rv init [project_directory] [OPTIONS]
  • project_directory optional - Creates an rv project at the directory specified

    Default: current directory (./)

  • --r-version - The R version is set to be the version found on the path by default. Use this flag to set a custom version.

  • --no-repositories - The repositories are set to what is found in the current R session, in option("repos"), by default. This flag leaves the repositories field in the config file blank.

  • --add - The dependency field is blank by default. This flag can be used to add dependencies you know will be needed to the project immediately. It does not sync these dependencies like rv add.

  • --no_r_environment - By default, rv creates an R environment .rv to enable rv to be called in R code (see rvr for more info). This flag will disable this R environment.

  • --force - By default, if an rproject.toml exists within a directory already, rv will not overwrite the file. The flag will force the creation of a new config file.

Follow the tabs below to see the changes:

Terminal window
rv init my_rv_project --r-version 4.5 --add tidyverse