Articles by Gregor Gorjanc

Read line by line of a file in R

December 1, 2013 | Gregor Gorjanc

Are you using R for data manipulation for later use with other programs, i.e., a workflow something like this:read data sets from a disk,modify the data, andwrite it back to a disk.All fine, but of data set is really big, then you will soon stumble on ... [Read more...]

Parse arguments of an R script

July 2, 2013 | Gregor Gorjanc

R can be used also as a scripting tool. We just need to add shebang in the first line of a file (script):#!/usr/bin/Rscriptand then the R code should follow.Often we want to pass arguments to such a script, which can be collected in the script by ... [Read more...]

Small pedigree based mixed model example

April 8, 2012 | Gregor Gorjanc

Pedigree based mixed models (often called animal models, due to modelling animal performance) are the cornerstone of animal breeding and quantitative genetics. There are many programs that can be used for analyzing your data with these models, e.g., ASREML, BLUPf90, MATVEC, MiXBLUP & MiX99,  SurvivalKit, PEST/VCE, WOMBAT, ...). There are ... [Read more...]

Regression – covariate adjustment

April 3, 2012 | Gregor Gorjanc

Linear regression is one of the key concepts in statistics [wikipedia1, wikipedia2]. However, people are often confuse the meaning of parameters of linear regression - the intercept tells us the average value of y at x=0, while the slope tells us how m... [Read more...]

GBLUP example in R

March 30, 2012 | Gregor Gorjanc

Shirin Amiri was asking about GBLUP (genomic BLUP) and based on her example I set up the following R script to show how GBLUP works. Note that this is the so called marker model, where we estimate allele substitution effects of the markers and not individual based model, where genomic ... [Read more...]

Polyploidy in sugarcane

September 28, 2011 | Gregor Gorjanc

While reading UseR conference abstracts I came across this sentence: "Sugarcane is polypoid, i.e., has 8 to 14 copies of every chromosome, with individual alleles in varying numbers." Vau! This generates really complex genotype system. Say we have biallelic gene with alleles being A and B. In diploids the possible genotypes ... [Read more...]

gRain: genetics example

April 14, 2011 | Gregor Gorjanc

gRain is an R package for "probability propagation in graphical independence networks, also known as probabilistic expert systems (which includes Bayesian networks as a special case)". This package caught my attention because some genetic models can b... [Read more...]

Converting strsplit() output to a data.frame

January 28, 2011 | Gregor Gorjanc

R has a nice set of utilities to work with strings. Function paste is surely one among these. It can be used to "glue" several strings with optional separator. The following example shows how paste can be used to create a new variable in a dataset: dat (dat$z Today ... [Read more...]

ASReml-R: Storing A inverse as a sparse matrix

December 18, 2010 | Gregor Gorjanc

I was testing ASReml-R program (an R package that links propriety ASReml binaries that can be used only with valid licence) this week and had to do some manipulations with the numerator relationship matrix (A). ASReml-R provides a function (asreml.Ainverse) that can create inverse of A directly from the ... [Read more...]

IPSUR book used LyX-Sweave

July 28, 2010 | Gregor Gorjanc

Jay Kerns wrote a book titled "Introduction to Probability and Statistics Using R" or IPSUR for short. He has put up a web site for the book and Rcmdr plugin. There are at least two very important points from my side (I did not read the book, yet): 1. ... [Read more...] in Eclipse-StatET

June 29, 2010 | Gregor Gorjanc

Sébastien Bihorel sent the following instructions on how to use my shell script in Eclipse-StatET. 1- First, you need to know the path to your TEXINPUTS settings. Type R CMD env |grep TEXINPUTS in a shell. In my installation (opensuse 11.2), the shell returned the followingTEXINPUTS=.::/usr/lib/... [Read more...]

R AnalyticFlow

January 21, 2010 | Gregor Gorjanc

R AnalyticFlow seems to be a nice tool to have a good overview over the analysis. The same kind of mode is available in Orange and SAS Enterprise Guide. I have not tried it yet, though. Does anyone have any experiences with it?Update on 2010-07-31: the...
[Read more...]

Galton’s quincunx in R

December 13, 2009 | Gregor Gorjanc

Andrej Blejec has a very nice R demo of Galton's quincunx (link1, link2). It is a bit tedious to copy the code from PDF to R console, but it is worth the effort as the demo simulation clearly shows the nature of quincunx. After a bit of search I also ... [Read more...]

Sweave-Lyx from terminal on Mac

November 12, 2009 | Gregor Gorjanc

Mark Heckmann writes:In your paper "Using Sweave with Lyx" (great work bty) you pointed out that one can see the sweave error code when processing when starting lyx from the terminal. I just changed from Windows to Mac so that's new for me. Could you s... [Read more...]


October 13, 2009 | Gregor Gorjanc

I am not a fan of MS Windows software. However, the reality is that majority of people use it and it is often easier for me to live with this than to convert the sorounding souls. Additionally I am find ing out lately that majority of my favourite open... [Read more...]
1 2 3

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)