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
withCallingHandlers( | |
remake::make(remake::list_targets()), | |
message = function(e) { | |
if (grepl("Joining, ", e$message)) { | |
by_clause <- gsub("Joining(.*)\n", "\\1", e$message) | |
clipr::write_clip(by_clause) | |
srcref <- testthat:::find_first_srcref(sys.calls()[-1:-15]) | |
srcfile <- attr(srcref, "srcfile")$filename | |
rstudioapi::navigateToFile(srcfile, srcref[1], srcref[2]) | |
stop("Insert by clause: ", by_clause) |
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(devtools) | |
devtools::load_all() | |
#' # Testing revdep_check() | |
#' | |
#' Functions: | |
create_deps_tested <- function() { | |
deps <- list( | |
testee = character(), |
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
--- | |
title: "Applying a function over rows of a data frame" | |
author: "Winston Chang" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
knitr::opts_chunk$set(collapse = TRUE, comment = "#>") | |
``` |
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
wget -np -k -e robots=off -r -l 1 https://github.com/krlmlr/tibble/milestones/ https://github.com/krlmlr/tibble/issues/ https://github.com/krlmlr/tibble/labels/ |
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
devtools::load_all() | |
envir <- as.environment("package:darn") | |
deps <- mvbutils::foodweb(where = envir, plotting = FALSE) | |
funmat <- deps$funmat | |
funs <- mget(colnames(funmat), envir, mode = "function") | |
fun_files <- | |
lapply(funs, attr, "srcref") %>% |
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
template <class Fun> | |
class ScopeGuard { | |
Fun f_; | |
bool active_; | |
public: | |
ScopeGuard(Fun f) | |
: f_(std::move(f)) | |
, active_(true) { | |
} | |
~ScopeGuard() { if (active_) f_(); } |
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
curl http://krlmlr.github.io/makeR/install | sh | |
make dt_test | |
make init-wercker | |
make init-gh-pages |
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
m1 <- png::readPNG("~/Downloads/m1.png") | |
m2 <- png::readPNG("~/Downloads/m2.png") | |
m1r <- m1[,,1] | |
m2r <- m2[,,1] | |
m1r1 <- m1r[,1] | |
m2r1 <- m2r[,1] | |
sim <- llply( |
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
--- | |
title: "Test" | |
output: html_document | |
--- | |
```{r setup} | |
knitr::dep_prev() | |
summary(cars) | |
``` |
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(reshape2) | |
N <- 100000L | |
d.m <- data.frame(q1=runif(N), q2=runif(N), q3=runif(N), | |
f=sample(letters, N, replace=T), w=runif(N)) | |
print(head(d.m)) | |
print(summary(d.m)) | |
sessionInfo() |