====== GNU R ====== The [[https://www.r-project.org/|GNU R programming language]] is often paired with [[https://posit.co/download/rstudio-desktop/|posit's RStudio Desktop IDE]] and a suit of libraries (language packages) known as [[:tools:tidyverse|tidyverse]] (includes ''dplyr'' and ''ggplot2''). You can also find a web interface to [[http://rhea.wpic.upmc.edu:8787/|Rstudio on rhea]] (also [[:admin:remoteaccess]]). [[:tools:tutorials|Tutorials]] contains additional resources. See [[:tools:r:issues]] for log of debugged problems. ===== Notes ===== ==== na.action ==== When adding module residuals back to a dataframe, you need ''residuals()'' to return the same length as the input data.frame. use ''lm(na.action=na.exclude)''. For example, d <- data.frame(x=c(1:4,NA),y=1:5); m <- lm(x~y,d,na.action=na.exclude); nrow(d); length(m$residuals); length(residuals(m)) [1] 5 [1] 4 [1] 5 This avoids the error Error in `$<-.data.frame`(`*tmp*`, ... replacement has 237 rows, data has 348 ===== Backlinks ===== {{backlinks>.}}