Include this in the .Rprofile
in the top-level directory of an RStudio project:
RPROJ <- list(PROJHOME = normalizePath(getwd()))
attach(RPROJ)
rm(RPROJ)
# Here are a few methods for getting text from PDF files. Do read through | |
# the instructions carefully! NOte that this code is written for Windows 7, | |
# slight adjustments may be needed for other OSs | |
# Tell R what folder contains your 1000s of PDFs | |
dest <- "G:/somehere/with/many/PDFs" | |
# make a vector of PDF file names | |
myfiles <- list.files(path = dest, pattern = "pdf", full.names = TRUE) |
"%p%" <- function(left, right){ | |
paste(left, right) | |
} |
% compile with | |
% R CMD Sweave sweave_ggplot.Rnw | |
% pdflatex sweave_ggplot.tex | |
\documentclass[t,ucs,12pt,xcolor=dvipsnames]{beamer} | |
\usepackage{fancyvrb} | |
\title{A sample Sweave demo} | |
\author{Author name} | |
\date{} |
#! /bin/sh | |
##################################################################################################### | |
# == Thumbs_db_killer == # | |
# This script delete all the Thumbs.db files on the curent folder, and on the sub-folders. # | |
# You can modify the $ennemy variable if you want to bulk-delete an other file (.Sync, of whatever).# | |
# @author : Tom Canac http://tomcanac.com/ # | |
# @version : 1.0 # | |
# @licence : CC-BY # | |
##################################################################################################### |
# Calculate age at a given reference date | |
# Create an interval between the date of birth and the enrollment date; | |
# intervals are specific to the two dates. Periods give the actual length | |
# of time between those dates, so convert to period and extract the year. | |
calc_age <- function(birthDate, refDate = Sys.Date()) { | |
require(lubridate) |
# Creating custom CDF for Affy chips in R / Bioconductor | |
```{r knitrOpts, echo=FALSE} | |
knit_hooks$set(inline = identity) # sets output for inline resutls nicely | |
knit_hooks$set(error = function(x, options) stop(x)) # kills knitr if there | |
# is an error, therefore we don't waste time generating error messages | |
options(save.defaults=list(compress="xz"), stringsAsFactors=FALSE) | |
# set up the default compression, and do NOT allow strings in data frames to become factors. | |
# That one is really important, and continually messes me up. | |
startTime <- Sys.time() # when did we start |