2318 search results for "map"

Coercion of matrix to sparse matrix (dgCMatrix) and maintaining dimnames.

January 20, 2013
By
Coercion of matrix to sparse matrix (dgCMatrix) and maintaining dimnames.

Consider the following matrix nr <- nc <- 6 set.seed <- 123 m <- matrix(sample(c(rep(0,9), 1),nr*nc, replace=T), nrow=nr, ncol=nc) sum(m)/length(m) 0.1667 dimnames(m) <- list(letters, letters) m a b c d e f a 0 0 0 0 0 1 b 0 0 0 1 0 1 c 0 0 0 0 0 0 d 0 0 0 0 0 0 e 1 1 0 0 0 0 f 0...

Read more »

Sums of Random Variables

January 19, 2013
By
Sums of Random Variables

I'm currently teaching first-level course in statistical inference for  (mostly) economics students. They've taken a one-semester course in descriptive (economic) statistics, and now we're dealing with sampling distributions, estimation, hypothesis testing, and simple regression analysis.When dealing with the sampling distribution of the sample mean, based on simple random sampling, we derived the result that this distribution has a...

Read more »

Power Calculations – relationship between test power, effect size and sample size

January 17, 2013
By
Power Calculations – relationship between test power, effect size and sample size

I was interested in modeling the relationship between the power and sample size, while holding the significance level constant (p = 0.05) , for the common two-sample t-Test. Luckily R has great support for power analysis and I found the function I was looking for in the package pwr. To calculate the power for the two-sample T-test

Read more »

SHODAN API in R (With Examples)

January 17, 2013
By
SHODAN API in R (With Examples)

Folks may debate the merits of the SHODAN tool, but in my opinion it’s a valuable resource, especially if used for “good”. What is SHODAN? I think ThreatPost summed it up nicely: “Shodan is a Web based search engine that discovers Internet facing computers, including desktops, servers and routers. The engine, created by programmer John

Read more »

Maize trade Part I: Generate the network diagram

January 17, 2013
By
Maize trade Part I: Generate the network diagram

It has been several month since my last post, partially due to the fact that my laptop was lost and several deadlines was approaching. Fortunately I will be returning to Taiwan and get a new laptop within a week, and will be updating regularly...

Read more »

Review of R Graphics Cookbook by Winston Chang

January 16, 2013
By

I just got a copy of Winston Chang's book R Graphics Cookbook, published by O'Reilly Media. This book follows now a series of O'Reilly books on R, including an R Cookbook. Winston Chang is a graduate student at Northwestern University but … Continue reading →

Read more »

audiolyzR: Data sonification with R

January 13, 2013
By
audiolyzR: Data sonification with R

In his talk “Give Your Data A Listen” at last summer’s useR! 2012 conference, Eric Stone presented joint work with Jesse Garrison on audiolyzR, an R package for “data sonification.” I thought this was a nifty and well-executed idea. Since I haven’t seen … Continue reading →

Read more »

Shading regions under a curve

January 11, 2013
By
Shading regions under a curve

Over on the Clastic Detritus blog, Brian Romans posted a nice introduction to plotting in R. At the end of his post, Brian mentioned he would like to colour in areas under the data curve corresponding to particular ranges of … Continue reading →

Read more »

Using Eigen for eigenvalues

January 11, 2013
By

A previous post showed how to compute eigenvalues using the Armadillo library via RcppArmadillo. Here, we do the same using Eigen and the RcppEigen package. #include <RcppEigen.h> // ] using Eigen::Map; ...

Read more »

Shading regions under a curve

January 11, 2013
By
Shading regions under a curve

Over on the Clastic Detritus blog, Brian Romans posted a nice introduction to plotting in R. At the end of his post, Brian mentioned he would like to colour in areas under the data curve corresponding to particular ranges of grain sizes. The comment area on a blog isn’t really amenable to giving a full answer to the...

Read more »