Closed rknx closed 4 years ago
Also add
.env <- new.env()
attach(.env)
.env$mutate =
options(stringsAsFactors=FALSE)
message("n Successfully loaded .Rprofile n")
.First <- function(){ if(interactive()){ library(utils) timestamp(,prefix=paste("##------ [",getwd(),"] ",sep="")) } }
.Last <- function(){ if(interactive()){ hist_file <- Sys.getenv("R_HISTFILE") if(hist_file=="") hist_file <- "~/.RHistory" savehistory(hist_file) } }
Set wd and proj name
options(radian.prompt = "\033[0;34mr$>\033[0m ")
Change to r:..AvrBsT >
where avrbst is project name
print.data.frame <- function(df) { if (nrow(df) > 10) { base::print.data.frame(head(df, 5)) cat("----\n") base::print.data.frame(tail(df, 5)) } else { base::print.data.frame(df) } }
All done except adding functions to .env
.env <- new.env() attach(.env) .env$mutate = ...
Or better
source("c:\data\rprojects\functions\prereqs.R) to rprofile