Skip to main content
Social Sci LibreTexts

1. Getting Started

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Don't be afraid! You don't have to be a master computer-programmer to work with R; it is very flexible and uses syntax that is simple and intuitive. 

    Where to Get R? 

    To download R, go to Click on the link to download for your specific computer.


    How do I use R?

    To use R, you will want to use RStudio, an integrated development environment. To download, go to and choose "RStudio Desktop". 


    Working RStudio

    There are 4 main components to RStudio: 

    Screen Shot 2019-10-28 at 6.16.26 PM.png


    The built-in text editor for writing scripts. Always write code in the source panel so that you can save it.


    Where commands are entered and output is printed.

    Environment & History

    An interactive list of all loaded objects and a list of keystrokes entered into the console.

    Files, Plots, Packages, Help:

    Where you can navigate C drive files, find output for plots, search for and install packages, and output for help commands. 


    Using a darker background and a larger font in RStudio will help reduce eye strain. See the image below for instructions. 

    Screen Shot 2019-10-28 at 6.29.09 PM.png

    Starting a Project

    To start a project, first, you must create a script.

    Screen Shot 2019-10-28 at 6.38.56 PM.png

    Code in R

    After creating a new R script, you will have to write in code to perform the actions you wish to complete your statistical analyses. 

    • To run code in R, type into each line the command/argument you want to run and use command (⌘) + enter. (For PC, use control + enter).
      • Functions are always followed by parentheses. A common mistake is forgetting a close parenthesis!
    • To run multiple lines of code, highlight the section then use command (⌘) + enter.

    Screen Shot 2019-10-09 at 12.06.30 PM.png

    1. Getting Started is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?