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
plotInfluence <- function (model, fill="white", | |
outline="black", size=30) { | |
require(ggplot2) | |
if(!inherits(model, "lm")) | |
stop("You need to supply an lm object.") | |
df<-data.frame(Residual=rstudent(model), | |
Leverage=hatvalues(model), | |
Cooks=cooks.distance(model), | |
Observation=names(hatvalues(model)), | |
stringsAsFactors=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
library(R6) | |
library(pryr) | |
# Class defining a storage for a local matrix | |
LocalMatrix <- R6Class("LocalMatrix", public = list(x = NULL)) | |
# Class defining a container for a shared matrix | |
SharedMatrix <- R6Class("SharedMatrix", public = list(e = LocalMatrix$new())) | |
# Initialize a shared container containing a local matrix and print it |
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(sn) | |
require(ggplot2) | |
x<-rsn(3000, 10, 30, 5) | |
ggplot(data.frame(counter=1, x=x), aes(x=x)) + theme_minimal() + ylab("Probability density") + geom_density() + geom_rug() + geom_vline(xintercept = 40, color="red") + geom_vline(xintercept = 22, color="orange") |
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
#!/bin/bash | |
mdir frames | |
ffmpeg -i video.mp4 -r 5 'frames/frame-%03d.jpg' | |
cd frames | |
convert -delay 20 -loop 0 *.jpg myimage.gif | |
cd .. | |
#rm -rf frames | |
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
#!/bin/bash | |
# Usage ./decryptunzip.sh myfolder.tar.xz.gpg | |
gpg -d "$1" | tar -xJvf - |
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
#!/bin/bash | |
dot -Tpng simpledag.dot > simpledag.png |
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
multinomial_visualization <- function(n=10, p=runif(5)){ | |
v<-sapply(p, function(x) n*x*(1-x)) | |
curve(n*x*(1-x), 0, 1) | |
points(p, v, col="red", pch=20) | |
} |
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(tibble) | |
library(dplyr) | |
library(tidyr) | |
if(!require(ggbiplot)){ | |
install.packages('devtools') | |
library(devtools) | |
devtools::install_github('vqv/ggbiplot') | |
} |
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
#!/bin/bash | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf "$1" |
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
#!/bin/bash | |
sudo docker stop $(sudo docker ps -a -q) | |
sudo docker rm $(sudo docker ps -a -q) | |
sudo docker volume rm $(sudo docker volume ls -q) |
OlderNewer