This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
p <- ggplot(mtcars, aes(cyl, mpg)) + geom_point() | |
# Standard png device, with type="cairo" | |
# Result: not antialiased | |
png('png_cairo.png', type="cairo") | |
p | |
dev.off() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create the test plot | |
library(ggplot2) | |
ggplot(mtcars, aes(disp, mpg)) + geom_point() | |
ggsave("t.pdf", width=5, height=5, compress=FALSE) | |
# Use this for large files | |
#ggplot(diamonds, aes(carat, price, colour=color)) + geom_point() | |
#ggsave("t.pdf", width=5, height=5, compress=FALSE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(RCurl) | |
require(plyr) | |
mytsv <- getURL("https://docs.google.com/spreadsheet/pub?key=0AhQ4CGoYYLyvdDd6b2Q5MG9ic2NoQWRPT3dLT0FyUkE&output=txt", ssl.verifypeer = FALSE) | |
raw <- read.delim(textConnection(mytsv), quote = "", stringsAsFactors = FALSE) | |
# Process the stuff from dput() on each row | |
parserow <- function(row) { | |
d <- eval(parse(text = row[[2]])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Find the range of the predictor variable, given the model object and the | |
#' name of the predictor variable | |
#' | |
# @examples | |
#' lm_mod <- lm(am ~ wt, data=mtcars) | |
#' model_xrange(lm_mod, "wt") | |
#' | |
#' mod_glm <- glm(am ~ wt, family=binomial, data=mtcars) | |
#' model_xrange(mod_glm, "wt") | |
#' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
index <- list( | |
list( | |
name = "Geoms", | |
description = "Geoms, short for geometric objects, describe the type of plot you will produce.", | |
items = list( | |
list( | |
name = "geom_abline", | |
description = "Line, specified by slope and intercept" ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
# To try out this script, run this, in the top-level ggplot2/ dir: | |
# git bisect reset | |
# git bisect start | |
# git bisect good ggplot2-0.9.0 | |
# git bisect bad ggplot2-0.9.1 | |
# git bisect run bisect/test_break_oob.r | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Useful online resources | |
# ggplot2 website: http://had.co.nz/ggplot2/ | |
# Mailing list: https://groups.google.com/forum/?fromgroups#!forum/ggplot2 | |
# Cookbook for R: http://wiki.stdout.org/rcookbook/ | |
install.packages('ggplot2') | |
# If you already have it installed, make sure it's up-to-date | |
update.packages() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <errno.h> | |
#include <fcntl.h> | |
#include <inttypes.h> | |
#include <linux/fs.h> | |
#include <linux/types.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/ioctl.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gtable tests | |
```{r setup, include=FALSE} | |
knit_hooks$set(optipng = hook_optipng) | |
``` | |
```{r} | |
library(devtools) | |
dev_mode() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# x-large high-cpu - set up | |
ec2-run-instances ami-82fa58eb --region us-east-1 --instance-type c1.xlarge --key ec2-keypair-us-east-1 --user-data-file bootstrap.sh | |
# Get IP address: | |
ec2-describe-instances --region us-east-1 | |
# Wait for a bit, then run: | |
./setup.sh ec2-23-20-74-242.compute-1.amazonaws.com a_vagrant_machine/ ~/.ec2/ec2-keypair-us-east-1 | |