Saturday, September 16, 2017

Setting Up R for Performing Basic Statistical Analyses

Installing Main Programs

Make sure these are installed.


Working in an R notebook allows you to keep a copy of the code you've run and generate output you can save and share.

  • R Studio - File - New File - New Notebook

R Studio Add Ins

R Studio allows for installation of add-ins. The GREA add-in which allows for the import of many types of data files into R seems like it will be useful.

(The code snippets which follow are R code insertions in an R notebook in R Studio.)


R Package Management for Specific Projects

I can never remember what packages I used after I tried something but I haven't worked on it for a while. I found keeping a list of the packages I need and letting R do the tedious work of making sure they're ready to use reduces my frustration level.



R Packages Mentioned in This Post


Saturday, September 2, 2017

R data exploration

histograms for all numeric variables in data frame
https://www.r-bloggers.com/quick-plot-of-all-variables/

> dataset %>%
+ keep(is.numeric) %>%
+ gather() %>%
+ ggplot(aes(value)) +
+ facet_wrap(~key, scales = "free") +
+ geom_histogram()

Plotting in R
http://www.stat.wisc.edu/~larget/stat302/chap2.pdf


data frame column types
numeric
double
interger
logical
factor

messy data frames
http://www.win-vector.com/blog/2015/04/what-can-be-in-an-r-data-frame-column/
POSIXlt
Arbitrary lists
Matrices
Data frames