This file contains 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
time15 | RUB_sol | MFA_sol | NFA_sol | NFY_sol | SFY_baro_air | NFA_baro_air | |
---|---|---|---|---|---|---|---|
4/30/2012 0:15 | 11.929 | 12.689 | 11.26 | 8.19 | 9.43 | 13.134 | |
4/30/2012 0:30 | 11.879 | 12.627 | 11.28 | 8.18 | 9.25 | 12.925 | |
4/30/2012 0:45 | 11.828 | 12.57 | 11.26 | 8.21 | 9.03 | 12.736 | |
4/30/2012 1:00 | 11.779 | 12.511 | 11.23 | 8.22 | 8.82 | 12.605 | |
4/30/2012 1:15 | 11.73 | 12.459 | 11.17 | 8.23 | 8.6 | 12.455 | |
4/30/2012 1:30 | 11.682 | 12.397 | 11.15 | 8.24 | 8.42 | 12.335 | |
4/30/2012 1:45 | 11.635 | 12.353 | 11.13 | 8.27 | 8.22 | 12.206 | |
4/30/2012 2:00 | 11.589 | 12.296 | 11.08 | 8.28 | 8.06 | 12.083 | |
4/30/2012 2:15 | 11.545 | 12.25 | 11.03 | 8.29 | 7.89 | 11.95 |
This file contains 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
4/30/2012 0:15 | 11.929 | 12.689 | 11.26 | 8.19 | 9.43 | 13.134 | |
---|---|---|---|---|---|---|---|
4/30/2012 0:30 | 11.879 | 12.627 | 11.28 | 8.18 | 9.25 | 12.925 | |
4/30/2012 0:45 | 11.828 | 12.57 | 11.26 | 8.21 | 9.03 | 12.736 | |
4/30/2012 1:00 | 11.779 | 12.511 | 11.23 | 8.22 | 8.82 | 12.605 | |
4/30/2012 1:15 | 11.73 | 12.459 | 11.17 | 8.23 | 8.6 | 12.455 | |
4/30/2012 1:30 | 11.682 | 12.397 | 11.15 | 8.24 | 8.42 | 12.335 | |
4/30/2012 1:45 | 11.635 | 12.353 | 11.13 | 8.27 | 8.22 | 12.206 | |
4/30/2012 2:00 | 11.589 | 12.296 | 11.08 | 8.28 | 8.06 | 12.083 | |
4/30/2012 2:15 | 11.545 | 12.25 | 11.03 | 8.29 | 7.89 | 11.95 |
This file contains 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
4/30/2012 0:15 | 11.929 | 12.689 | 11.26 | 8.19 | 9.43 | 13.134 | |
---|---|---|---|---|---|---|---|
4/30/2012 0:30 | 11.879 | 12.627 | 11.28 | 8.18 | 9.25 | 12.925 | |
4/30/2012 0:45 | 11.828 | 12.57 | 11.26 | 8.21 | 9.03 | 12.736 | |
4/30/2012 1:00 | 11.779 | 12.511 | 11.23 | 8.22 | 8.82 | 12.605 | |
4/30/2012 1:15 | 11.73 | 12.459 | 11.17 | 8.23 | 8.6 | 12.455 | |
4/30/2012 1:30 | 11.682 | 12.397 | 11.15 | 8.24 | 8.42 | 12.335 | |
4/30/2012 1:45 | 11.635 | 12.353 | 11.13 | 8.27 | 8.22 | 12.206 | |
4/30/2012 2:00 | 11.589 | 12.296 | 11.08 | 8.28 | 8.06 | 12.083 | |
4/30/2012 2:15 | 11.545 | 12.25 | 11.03 | 8.29 | 7.89 | 11.95 |
This file contains 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
proftable <- function(file, lines=20) { | |
require(plyr) | |
sample.interval <- as.numeric(strsplit(readLines(file, 1), "=")[[1L]][2L])/1e+06 | |
profdata <- as.matrix(read.table(file, header=FALSE, sep=" ", colClasses="character", skip=1, fill=TRUE, na.strings="")) | |
total.time <- nrow(profdata)*sample.interval | |
stacktable <- data.frame(table(aaply(profdata, 1, function(x) paste(rev(na.omit(x)), collapse=" > ")))) | |
names(stacktable) <- c("Stack","PctTime") | |
stacktable$PctTime <- 100*stacktable$PctTime/nrow(profdata) | |
stacktable <- stacktable[order(stacktable$PctTime, decreasing=TRUE), c("PctTime", "Stack")] | |
rownames(stacktable) <- NULL |
This file contains 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
/* Install the Stylish extension for your browser, add this code | |
as a new Style, and apply it to the domain 'tweetdeck.twitter.com' */ | |
/* You can get Stylish here: */ | |
/* Safari - http://sobolev.us/stylish/ */ | |
/* Chrome - https://chrome.google.com/webstore/detail/stylish/fjnbnpbmkenffdnngjfgmeleoegfcffe */ | |
/* Tweet improvements, comments, or corrections to @mcnees. */ | |
/* ------------------------------------------------------------- */ |
This file contains 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
#Looking for a fast way to find the N minimum values in a vector of values. For use in finding nearest neighbors when one already has a (large) distance matrix. | |
x <- runif(5000) | |
n <- 3 | |
system.time({ # What I'm using now | |
for(i in 1:10000) { | |
a <- sort(x)[1:n] | |
b <- match(a, x) | |
} |
This file contains 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
##### Visualizing keystrokes using ggplot2 ##### | |
library(ggplot2) | |
# a character string to visualize: | |
string <- 'R is an integrated suite of software facilities for data manipulation, calculation and graphical display.' | |
# a data.frame representing the keys of a qwerty keyboard | |
qwerty <- data.frame( | |
id = 1:47, |
This file contains 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(dplyr) | |
library(tidyr) | |
library(ggplot2) | |
library(gridExtra) | |
df = data_frame(a = rnorm(100, mean=1), b=rnorm(100, mean=2), c=rnorm(100, mean=0)) %>% | |
gather("var", "value", a,b,c) | |
ggplot(df, aes(x=value)) + | |
geom_density(fill="black", col="white", lwd=1) + |
This file contains 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
#'% How to format plots for publication using `ggplot2` (with some help from Inkscape) | |
#'% Rosemary Hartman | |
#'% 13-11-20 19:51:47 | |
#' | |
#' ***The following is the code from a presentation made by Rosemary Hartman to | |
#' the [Davis R Users' Group](http://www.noamross.net/davis-r-users-group.html). | |
#' I've run the code through the `spin` function in `knitr` to produce this post. | |
#' Download the script to walk through [here](https://gist.github.com/noamross/7576436)*** | |
#' | |
#' First, make your plot. I am going to use the data already in R |
This file contains 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
# I believe I found a bug in R's quartz() device, specifically it's | |
# GECap method (the C routine called by dev.capture). The following | |
# yields the two images in the comment below. This occurs whether working | |
# from the terminal or RStudio. This works fine with Cairo devices that | |
# support raster capture. | |
quartz() | |
plot(1,1) | |
aa <- dev.capture() | |
dev.size("px") |