I hereby claim:
- I am wjhopper on github.
- I am whopper (https://keybase.io/whopper) on keybase.
- I have a public key whose fingerprint is B703 3199 97F5 7774 B0C9 4FAC 7048 A20E F958 73DF
To claim this, I am signing this object:
library(rstudio.prefs) | |
use_rstudio_prefs( | |
save_workspace = "never", # General --> Basic --> Save Workspace | |
load_workspace = FALSE, # General --> Basic --> Restore .RData | |
restore_last_project = FALSE, # General --> Basic --> Restore most recent project | |
restore_source_documents = FALSE, # General --> Basic --> Restore previously open source documents | |
check_for_updates = FALSE, # General --> Basic --> Check for updates | |
if (.Platform$OS.type == "windows") { | |
folder <- file.path(Sys.getenv("AppData"), "RStudio", "templates") | |
} else { | |
folder <- "~/.config/rstudio/templates" | |
} | |
if (!dir.exists(folder)) { dir.create(folder, recursive = TRUE) } | |
f <- file(file.path(folder, "default.Rmd") ,"wt") |
#! \bin\bash | |
## This script is to help clean up the experiment manager backups | |
cd /media/PatricksHD/CC9_Backups | |
touch removal_list.txt | |
# Compressed tarballs of the pydio user data directory are taken twice a day with a cron job | |
# The filenames follow the naming convention pydio_userdata_backup_YYYY-MM-DD_HH-MM.tar.bz | |
# Thus, this script assumes that the date of a backup can be extacted by splitting |
library(pryr) | |
sample_df <- data.frame(a = 1:5, b = 5:1, c = c(5, 3, 1, 4, 1)) | |
scramble <- function(x) x[sample(nrow(x)), ] | |
subset1 <- function(x, cond) { | |
condition_call <- substitute(cond) | |
r <- eval(condition_call, x, parent.frame()) | |
x[r, ] |
#The task: sum 1000 different 10x10 matrices stored in a list | |
matrices <- vector(mode="list", length=1000) | |
for (i in seq_along(matrices)) { | |
matrices[[i]] <- matrix(rnorm(1000), 10, 10) | |
} | |
f1 <- function () { | |
S <- matrix(0, 10, 10) | |
for (M in matrices) { |
library(ggplot2) | |
library(scales) | |
library(gridExtra) | |
set.seed(20) | |
n <- 10 | |
y <- rexp(n, 2) | |
dat <- data.frame( | |
xval = rep(c("A","B"), n/2), | |
yval = y, |
I hereby claim:
To claim this, I am signing this object:
# Create a function programmatically by creating its constituents: | |
# an argument list, a function body of expressions, and an enclosing environment | |
args <- alist(x=,y=) | |
exps <- expression(z <- x^2 + y^2, z <- sqrt(z), return(z)) | |
body <- as.call(c(as.name("{"), exps)) | |
f <- as.function(x = c(args,body), envir = parent.frame()) | |
f(x=1,y=1) |
%--------------------------------------------------------% | |
% Onscreen script to record race/ethnic/sex demographics % | |
% for Matlab % | |
% Updated 09/21/2015 % | |
%--------------------------------------------------------% | |
%{ | |
Purpose: | |
A Matlab script which will generate a set of dialog boxes that ask | |
participants an assortment of questions regarding demographics (in |
## Some sort of list comprehension using only functional programming | |
## techniques that returns a list holding the coefficients of variation | |
## (i.e. the mean divided by the standard deviation) for each column in the | |
## mtcars data set. | |
## This isn't the clearest code (i.e. its really hard to tell its dividing | |
## the mean by the standard deviation) but it uses absolutely no imperative control | |
## flow structures and no vectorized R functions, so if you can read and understand | |
## this you can do you some functional programming for great good =). I can't believe I | |
## actually figured this out, much less that I figured it out in like 5 minutes, |