(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
license: mit | |
height: 300 | |
scrolling: no | |
border: no |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
shinyServer(function(input, output) { | |
output$obs <- renderUI({ | |
sliderInput("obs", "Number of observations:", | |
min = 10000, max = 90000, | |
value = 50000, step = 10000) | |
}) | |
output$distPlot <- renderPlot({ | |
if (!is.null(input$obs)) { | |
dist <- NULL | |
for (i in 1:input$obs) { |
This script generates random numbers along a Normal or Log-normal distribution using the Marsaglia polar method.
normalRandom
: Generate random numbers that follow a Normal distribution.normalRandomInRange
: Generate random numbers that follow a Normal distribution but are clipped to fit within a rangenormalRandomScaled
: Generate random numbers that follow a Normal distribution with a given mean and standard deviationlnRandomScaled
: Generate random numbers that follow a Log-normal distribution with a given geometric mean and geometric standard deviationLatency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
#List of most used R packages that we wish to install. | |
libraries = c('cacheSweave', 'Deducer', 'devtools', 'doBy', 'foreign', 'gdata', | |
'ggplot2', 'Hmisc', 'JGR', 'lubridate', 'maps', 'mapdata', 'mapproj', | |
'maptools', 'proto', 'psych', 'R2wd', 'RCurl', 'reshape', | |
'RODBC', 'roxygen2', 'seqinr', 'sm', 'sp', 'sqldf', 'survey', | |
'WriteXLS', 'XML', 'xtable') | |
#We will install packages from the main CRAN site | |
repos = 'http://cran.r-project.org' | |
#Site provides some prebuilt binaries for Windows |