R/add_to_rprofile.R

Defines functions add_fcuk_to_rprofile

Documented in add_fcuk_to_rprofile

#' Add library(fcuk) to the .Rprofile file
#' 
#' After calling this function, fcuk will be launched everytime you launch
#' your current R project.
#' 
#' @export
#' @examples
#' fcuk::add_fcuk_to_rprofile()
add_fcuk_to_rprofile <- function(){
  
  if ((file.exists(".Rprofile") &&
      !any(readLines(".Rprofile")=="library(fcuk)"))|!file.exists(".Rprofile")){
      cat("\nlibrary(fcuk)\n",file = ".Rprofile",append = TRUE)
  }
}

Try the fcuk package in your browser

Any scripts or data that you put into this service are public.

fcuk documentation built on May 1, 2019, 10:22 p.m.