Skip to content

Instantly share code, notes, and snippets.

View gu-mi's full-sized avatar

Gu Mi gu-mi

  • Sanofi
  • Cambridge, MA
View GitHub Profile
@gu-mi
gu-mi / replace.R
Created May 12, 2014 15:34
replace @S3method with @export
# http://trinkerrstuff.wordpress.com/2014/05/12/handling-s3methods-death-in-roxygen-4-0-0/
pth <- "C:/Users/trinker/qdap/R"
fls <- file.path(pth, dir(pth))
FUN <- function(x) {
cont <- readLines(x)
cont[grepl("#' @S3", cont)] <- "#' @export"
cont[length(cont) + 1] <- ""
@gu-mi
gu-mi / install_load_pkgs.R
Created May 19, 2014 02:03
Detect which packages are not installed, and then install them and load all required packages into session.
# check if you need to install these packages
pkg <- c("RODBC", "ggplot2")
inst <- pkg %in% installed.packages()
# inst
if (length(pkg[!inst]) > 0) {
install.packages(pkg[!inst])
}
# load all required packages into session
lapply(pkg, library, character.only = TRUE)
@gu-mi
gu-mi / color_scheme.sh
Created May 24, 2014 21:00
TeXShop color scheme
# solarized light color scheme for my TexShop setup
defaults write TeXShop background_R 0.99
defaults write TeXShop background_G 0.96
defaults write TeXShop background_B 0.89
defaults write TeXShop commandred 0.0
defaults write TeXShop commandgreen 0.0
defaults write TeXShop commandblue 1.0