Created
November 22, 2011 20:36
-
-
Save thinkerbot/1386858 to your computer and use it in GitHub Desktop.
R examples
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
###################################################### | |
# http://www.r-bloggers.com/ascii-scatterplots-in-r/ | |
source("http://biostatmatt.com/R/scat.R") | |
x <- sin(seq(0,2*pi,length.out=30)) | |
scat(x, cols=15, rows=8) | |
# ___________________ | |
# | | | |
# | * | | |
# | **** | | |
# | * * | | |
# | * * | | |
# | * ** * | | |
# | * * | | |
# | * * | | |
# | **** | | |
# |___________________| | |
# |
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
# Normal Distribution | |
# * 1000 datapoints | |
# * 100 mean | |
# * 10 std dev | |
R --slave -e 'write(rnorm(1000, 100, 10), "", sep = "\\n")' | |
# https://github.com/holman/spark | |
R --slave -e 'write(rnorm(1000, 0, 5), "", sep = "\\n")' | cut -d '.' -f 1 | sort -g | uniq -c | sed -e "s/^ \{1,\}//" | cut -d ' ' -f 1 | bash spark.sh | |
# alternatively | |
R --slave -e 'write(rnorm(1000, 0, 5), "", sep = "\\n")' | cut -d '.' -f 1 | sort -g | uniq -c | sed -e "s/^ \{1,\}//" | cut -d ' ' -f 1 | ruby -ne 'puts "*" * $_.to_i' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment