November 2007

Convert factors to numbers

November 29, 2007 | Forester

If you have a vector of factors it is easy to get the factor level; however, I always forget how to extract the factor value. I ran into the answer here. __ x x [1] 1.61 1.12 1.26 0.09 -0.13 0.16 -0.03 -0.1 0.09 -0.47 [11] A B Levels: -0.03 0.09 -0.1 -0.13 0.16 -0.47 1.12 1.26 1.61 A B__ as.numeric(x) [1] 9 7 8 2 4 5 1 3 2 6 10 11 NA__ ... [Read more...]

An R-based genetic algorithm

November 19, 2007 | Egon Willighagen

During my PhD I wrote a simple but effective genetic algorithm package for R. Because there was a bug recently found, and there is interest in extending the functionality, I have set up a SourceForge project called genalg.The package provides GA support for binary and real-value chromosomes (and integer ... [Read more...]

Preparing plots for publication

November 15, 2007 | Forester

The plotting capabilities of R are excellent; however, when I am preparing a figure for publication, I often need to combine multiple plots or add objects (e.g., arrows or text) to an existing plot. While this can be accomplished in R, my patience for ... [Read more...]

Linear panel data models in R: The PLM package

November 10, 2007 | dataninja

The plm package for R lets you run a number of common panel data models, including The fixed effects (or within) estimator The random effects GLS estimator It also allows for general GLS estimation, as well as GMM estimation, and includes a feature for heteroscedasticity consistent covariance estimation. It’s ... [Read more...]

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)