Skip to content

Instantly share code, notes, and snippets.

@ggarza
ggarza / pareto.R
Created December 11, 2012 21:43
An R script that creates a pareto diagram.
# tikz("./figures/pareto.tikz", width=6.0, height=3.50)
defects <- c(56, 45, 23, 12, 8, 6)
names(defects) <- c("Blem.", 'Scratch', 'Chip', 'Bend', 'Dent',
'Others')
defects_sort <- sort(defects, decreasing=TRUE)
# par(mar = c(5, 4, 4, 4) + 0.3)
par(mar = c(5, 4, 3, 4) + 0.3)
bp <- barplot(defects,
# panel.first=grid(ny=NULL, nx=NA, lty="dashed", col="black"),
ylim=c(0, sum(defects)* 1.05),
@ggarza
ggarza / Makefile
Last active July 17, 2018 13:20
A Makefile for Knitr
# Makefile for knitr
# optionally put all RNW files to be compiled to pdf here, separated by spaces
RNW_FILES= $(wildcard *.Rnw)
# location of Rscript
R_HOME?=/Library/Frameworks/R.framework/Resources
# these pdf's will be compiled from Rnw and Rmd files
PDFS= $(RNW_FILES:.Rnw=.pdf)