remove_from_.First_in_Rprofile.site: Remove a code line from Rprofile.site .First

View source: R/startup.R

remove_from_.First_in_Rprofile.siteR Documentation

Remove a code line from Rprofile.site .First

Description

Goes through Rprofile.site text, finds a line of code - and removes it.

Usage

remove_from_.First_in_Rprofile.site(code, fixed = TRUE, ...)

Arguments

code

A character scalar with code to add at the beginning of the .First function in Rprofile.site

fixed

passed to grep

...

passed to grep

Value

logical. Did we remove that line or not (in case it was not there)

References

https://stackoverflow.com/questions/1395301/how-to-get-r-to-recognize-your-working-directory-as-its-working-directory https://stackoverflow.com/questions/1189759/expert-r-users-whats-in-your-rprofile http://www.noamross.net/archives/2012-11-02-rprofile/ https://www.statmethods.net/interface/customizing.html

Examples

## Not run: 
is_in_.First_in_Rprofile.site("suppressMessages(library(installr))") # FALSE
add_to_.First_in_Rprofile.site("suppressMessages(library(installr))")
is_in_.First_in_Rprofile.site("suppressMessages(library(installr))") # TRUE
remove_from_.First_in_Rprofile.site("suppressMessages(library(installr))")
is_in_.First_in_Rprofile.site("suppressMessages(library(installr))") # FALSE
# this would still leave .First

## End(Not run)

installr documentation built on Nov. 13, 2022, 1:06 a.m.