#Getting Started With R
This document is not exhaustive and just shows what you need to get R and RStudio on your computer.
##Download R
- Option 1 Download R from cran.r-project.org (most widely used). https://cran.r-project.org/bin/windows/base/
- Option 2 Download Microsoft R Open from MRAN. Use MRO to take advantage of multithreading capabilities. https://mran.revolutionanalytics.com/download/
######After downloading, open the program and verify that R is running in the window.
You should see text similar to this:
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.
Microsoft R Open 3.3.1 The enhanced R distribution from Microsoft Microsoft packages Copyright (C) 2016 Microsoft Corporation
Using the Intel MKL for parallel mathematical computing(using 4 cores).
Default CRAN mirror snapshot taken on 2016-07-01. See: https://mran.microsoft.com/.
##Download RStudio
Many people don't like the included R client and use RStudio instead.
- RStudio can be downloaded from https://www.rstudio.com/products/rstudio/download/
When you open RStudio for the first time, you should see a Console window showing R version information similar to the standard R client that you just installed.
##Using Packages
To install a package, such as ggplot2, at the carat > type install.packages("ggplot2") then press ENTER. Read the console output to see the results, errors, or additional packages installed.
To use an installed package you have to load it. At the carat > type library(ggplot2) the press ENTER. You should immediatly go to a new carat on a new line.
The install.packages command by default downloads packages from CRAN.
R is case sensitive.
- A full list of packages available at CRAN can be viewed at https://cran.r-project.org/web/packages/available_packages_by_name.html
##Suggested Packages To Get Started
- RODBC (if you have databases accessible via ODBC)
- ROracle (if you have data in Oracle databases)
- ggplot2 (plotting, graphing, and charts)
- data.table, dplyr, tidyr (data wrangling/reformatting data frames)
- lubridate (helps with date and datetime operations)