Skip to content

Instantly share code, notes, and snippets.

@tgh0831
Last active November 2, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgh0831/92cf0d3d69d5bafc992b0e3194650492 to your computer and use it in GitHub Desktop.
Save tgh0831/92cf0d3d69d5bafc992b0e3194650492 to your computer and use it in GitHub Desktop.
Getting started with R

#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

######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.

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.

##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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment