rknx / AvrBsT

Statistical analysis of bacterial dispersal in R
https://anujs.com.np/avrbst
1 stars 0 forks source link

Add prerequisites to .Rprofile #16

Closed rknx closed 4 years ago

rknx commented 4 years ago

Or better

source("c:\data\rprojects\functions\prereqs.R) to rprofile

rknx commented 4 years ago

Also add

.env <- new.env()

attach(.env)

.env$mutate =

rknx commented 4 years ago

options(stringsAsFactors=FALSE)

rknx commented 4 years ago

message("n Successfully loaded .Rprofile n")

rknx commented 4 years ago

.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) } }

rknx commented 4 years ago

Set wd and proj name

rknx commented 4 years ago

options(​radian.prompt​ ​=​ ​"​\0​33[0;34mr$>​\0​33[0m ​"​)

Change to r:..AvrBsT >

where avrbst is project name

rknx commented 4 years ago

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) } }

rknx commented 4 years ago

All done except adding functions to .env

.env <- new.env() attach(.env) .env$mutate = ...