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
#!/usr/bin/env Rscript | |
# Small R shebang script (useable from a shell) to convert R markdown files into HTML or PDF format | |
# using the knitr package. | |
# | |
# Place this file in a directory in your $PATH or create an alias to it, e.g. in your '.bashrc': | |
# alias knit='/path/to/script' | |
# alias knit2html='/path/to/script --html' | |
# alias knit2pdf='/path/to/script --pdf' | |
# |
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
#!/usr/bin/env Rscript | |
### Toggle debug blocks on and off in a fashion of a pre-processor | |
# usage: toggle_debug [uri] [on|off] | |
# | |
# Argument uri can be a single file or directory. | |
# In case of a directory, the script processes all ".[rR]$" files inside and | |
# only writes changes if processing is successful for all files found. | |
# | |
# Debug blocks start with the comment "BDEBUG" and end with "EDEBUG" |
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
function Tmpwatch(path, days) | |
let l:path = expand(a:path) | |
if isdirectory(l:path) | |
for file in split(globpath(l:path, "*"), "\n") | |
if localtime() > getftime(file) + 86400 * a:days && delete(file) != 0 | |
echo "Tmpwatch(): Error deleting '" . file . "'" | |
endif | |
endfor | |
else | |
echo "Tmpwatch(): Directory '" . l:path . "' not found" |
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(randomForest) | |
data(iris) | |
mydata = iris | |
############################################################################### | |
### sequential | |
############################################################################### | |
randomForest(Species ~ ., data = mydata, ntree = 1000) |
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
tryCatchDebug = function(expr) { | |
handler_warning = function(w) { | |
cache.warnings <<- c(cache.warnings, w) | |
invokeRestart("muffleWarning") | |
} | |
handler_error = function(e) { | |
catched.error <<- TRUE | |
dump.frames(".lastDump") | |
dumped = get(".lastDump", envir = .GlobalEnv) |
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
cart_iter = function(li) { | |
nextState = function(state, pos = 1L) { | |
if (state[pos] < state.last[pos]) | |
replace(state, pos, state[pos] + 1L) | |
else | |
nextState(replace(state, pos, 1L), pos + 1L) | |
} | |
nextElem = function() { | |
state <<- nextState(state) |
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
function! GitFZF() | |
let l:git_root = system('git rev-parse --show-toplevel 2> /dev/null') | |
if empty(l:git_root) | |
execute 'FZF' | |
else | |
echom l:git_root | |
call fzf#run({ | |
\ 'source' : 'git ls-tree -r --full-tree --name-only HEAD', | |
\ 'sink' : 'e', | |
\ 'dir' : substitute(l:git_root, "\n$", '', ''), |
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
* installing *source* package 'fmrmr' ... | |
** libs | |
*** arch - i386 | |
g++ -I"D:/RCompile/recent/R-3.1.2/include" -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include" -O3 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o | |
g++ -I"D:/RCompile/recent/R-3.1.2/include" -I"d:/RCompile/CRANpkg/lib/3.1/Rcpp/include" -I"d:/RCompile/CRANpkg/lib/3.1/RcppArmadillo/include" -I"d:/Rcompile/CRANpkg/extralibs215/local215/include" -O3 -Wall -mtune=core2 -c mrmr.cpp -o mrmr.o | |
g++ -shared -s -static-libgcc -o fmrmr.dll tmp.def RcppExports.o mrmr.o -LD:/RCompile/recent/R-3.1.2/bin/i386 -lRlapack -LD:/RCompile/recent/R-3.1.2/bin/i386 -lRblas -lgfortran -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib/i386 -Ld:/Rcompile/CRANpkg/extralibs215/local215/lib -LD:/RCompile/recent/R-3.1.2/bin/i386 -lR | |
installing to d:/RCompile/CRANguest/R-release/lib/fmrmr/libs/i386 | |
*** arch - x64 |
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(microbenchmark) | |
library(compiler) | |
library(ggplot2) | |
library(checkmate) | |
library(assertive) | |
library(assertthat) | |
bench = function(x, funs, repeats = 100) { | |
force(x) | |
microbenchmark(times = repeats, |
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
Index: src/library/parallel/R/unix/mcparallel.R | |
=================================================================== | |
--- src/library/parallel/R/unix/mcparallel.R (Revision 71169) | |
+++ src/library/parallel/R/unix/mcparallel.R (Arbeitskopie) | |
@@ -52,24 +52,26 @@ | |
if (missing(jobs)) jobs <- children() | |
if (!length(jobs)) return (NULL) | |
if (isTRUE(intermediate)) intermediate <- utils::str | |
+ pids <- if (inherits(jobs, "process") || is.list(jobs)) | |
+ processID(jobs) else jobs |
OlderNewer