Publications by heuristicandrew

doSMP removed from CRAN

17.02.2012

If you do parallel processing in R on Windows, then you probably have heard of the doSMP package. However, it was recently removed from the CRAN repository with the terse message: Package ‘doSMP’ was removed from the CRAN repository. Revolution … Continue reading → Related To leave a comment for the author, please follow the...

688 sym 2 img

Scales and transformations in ggplot2 0.9.0

14.03.2012

Some R code designed for ggplot2 0.8.9 is not compatible with ggplot2 0.9.0, and today the ggplot2 web site has outdated documentation which gives this broken example: Dennis Murphy points to the ggplot2 0.9.0 transition guide from where I derived … Continue reading → Related To leave a comment for the author, please follow the ...

691 sym 2 img

Plotting individual growth charts

14.03.2012

This R code draws individual growth plots as shown in “Applied Longitudinal Data Analysis: Modeling Change and Event Occurrence” by Judith D. Singer and John B. Willett, an excellent book on multilevel modeling and survival analysis. This code recreates figure … Continue reading → Related To leave a comment for the author, p...

704 sym 2 img

Comparing continuous distributions with R

13.06.2012

In R we’ll generate similar continuous distributions for two groups and give a brief overview of statistical tests and visualizations to compare the groups. Though the fake data are normally distributed, we use methods for various kinds of continuous distributions. … Continue reading → Related To leave a comment for the author...

709 sym 2 img

nnet2sas() supports centering and scaling

04.10.2012

nnet2sas() version 1 introduced a way to export a nnet() model trained in R to Base SAS through metaprogramming, and now nnet2sas() version 2 introduces support for variable centering and scaling as implemented in caret::train(). See the link for version … Continue reading → Related To leave a comment for the author, please foll...

698 sym 2 img

lag function for data frames

29.10.2012

When applying the stats::lag() function to a data frame, you probably expect it will pad the missing time periods with NA, but lag() doesn’t. For example: Nothing happened. Here is an alternative lag function made for this situation. It pads … Continue reading → Related To leave a comment for the author, please follow the link...

685 sym 2 img

Popup notification from R on Windows

19.04.2013

After R is done running a long process, you may need to notify the operator to check the R console and provide the next commands. Without installing any more software or creating any batch files or VBS scripts, here is a simple way to create the popup notice in Windows Continue reading → Related To leave a comment for the author,...

712 sym 2 img

Geolocate IP addresses in R

20.05.2013

This R function uses the free freegeoip.net geocoding service to resolve an IP address (or a vector of them) into country, region, city, zip, latitude, longitude, area and metro codes. Continue reading → Related To leave a comment for the author, please follow the link and comment on their blog: Heuristic Andrew » r-project. R-...

626 sym 2 img

Calculate RMSE and MAE in R and SAS

12.07.2013

Here is code to calculate RMSE and MAE in R and SAS. RMSE (root mean squared error), also called RMSD (root mean squared deviation), and MAE (mean absolute error) are both used to evaluate models. MAE gives equal weight to all errors, while RMSE gives extra weight to large errors. Continue reading → Related To leave a comment fo...

725 sym 2 img

Bar plot with error bars in R

20.10.2013

Here’s a simple way to make a bar plot with error bars three ways: standard deviation, standard error of the mean, and a 95% confidence interval. The key step is to precalculate the statistics for ggplot2. Continue reading → Related To leave a comment for the author, please follow the link and comment on their blog: Heuristic...

649 sym 2 img