This is first in a series of posts about creating simulations in R. As a foundational discussion, I first look …Continue reading »

Often in SEM scripts you will see matrices being pre- and post-multiplied by some other matrix. For instance, this figures in scripts computing the genetic correlation between variables. How does pre- and post-multiplying a variance...

Last part of our short series about the Finnish social security number (Fssn). You can check part 1 here, and part 2 here. This last post we are interested in generating random Fssn's. This has no real world applications. It is just a coding excercis...

Continuing our theme from last time. The Finnish social security number (FSSn) has the form xxxxxxyzzzq, where the check digit is q. If you want to check if the FSSn is real the check digit is matched to the remainder of xxxxxxzzz / 31. The check di...

At its very essence, Rcpp permits easy access to native R objects at the C++ level. R objects can be simple vectors, list or matrices; compound data structures created from these; objects of S3, S4 or Reference Class vintage; or language objects a...

Update on 2013/01/05: Xiao Nan in the comments pointed out that apply(combn(letters, 2), 2, paste0, collapse = '') was wrong for all two-letter usernames, and indeed it was. It is not a combination problem. Now I use his elegant outer() solution. One can also use expand.grid(letters, letters). Github decided to take off their downloads service, and I was very...

Today I’m very happy and so excited to announce my new book PLS Path Modeling with R, freely available in pdf format at: www.gastonsanchez.com/PLS_Path_Modeling_with_R.pdf After working and writing insanely for a couple of months in the last quarter of 2012, I’ve finally achieved this personal milestone that means so much to me. What started as a … Continue reading...

e-mails with the latest R posts.

(You will not see this message again.)