Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

edit

Open configuration files


Description

  • edit_r_profile() opens .Rprofile

  • edit_r_environ() opens .Renviron

  • edit_r_makevars() opens .R/Makevars

  • edit_git_config() opens .gitconfig or .git/config

  • edit_git_ignore() opens .gitignore

  • edit_rstudio_snippets() opens RStudio's snippet config for the given type.

  • edit_rstudio_prefs() opens RStudio's preference file.

Usage

edit_r_profile(scope = c("user", "project"))

edit_r_environ(scope = c("user", "project"))

edit_r_buildignore(scope = c("user", "project"))

edit_r_makevars(scope = c("user", "project"))

edit_rstudio_snippets(
  type = c("r", "markdown", "c_cpp", "css", "html", "java", "javascript", "python",
    "sql", "stan", "tex")
)

edit_rstudio_prefs()

edit_git_config(scope = c("user", "project"))

edit_git_ignore(scope = c("user", "project"))

Arguments

scope

Edit globally for the current user, or locally for the current project

type

Snippet type (case insensitive text).

Details

The edit_r_*() functions consult R's notion of user's home directory. The edit_git_*() functions (and usethis in general) inherit home directory behaviour from the fs package, which differs from R itself on Windows. The fs default is more conventional in terms of the location of user-level Git config files. See fs::path_home() for more details.

Files created by edit_rstudio_snippets() will mask, not supplement, the built-in default snippets. If you like the built-in snippets, copy them and include with your custom snippets.

Value

Path to the file, invisibly.


usethis

Automate Package and Project Setup

v2.0.1
MIT + file LICENSE
Authors
Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Jennifer Bryan [aut, cre] (<https://orcid.org/0000-0002-6983-2759>), RStudio [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.