• Unit 1: Introduction to R and RStudio

    R is a language for statistical computing and free, open-source software provided by The R Foundation for Statistical Computing. The software comes with a free R editor, which is an interface that allows accessing R functionality and writing and executing R code. However, many other code editors and integrated development environments (IDEs), both free and commercial, extend the standard editor functionality and are often more convenient. In this unit, we start exploring R and RStudio IDE and introduce basic practices for coding and organizing your files.

    Completing this unit should take you approximately 2 hours.

    • 1.1: R and Coding Environments

      The first thing is to understand what R is and how to interact with this language once installed on your computer. In this section, you will also learn a brief history of R and its potential applications.

    • 1.2: Installing and Setting Up R and RStudio

      The best way to master coding is by practice. This section explains how to install the R software and RStudio integrated development environment that provides a convenient interface for interacting with R and a variety of developer tools.

    • 1.3: Command Line and Script

      The two most common ways to execute a command in R are: 1) type it directly in the R console or 2) write the command in a plain-text file (called "script"; R scripts usually have the file extension *.R) that can be saved, modified, and executed. Working in the console directly is appropriate when you do not need to save or modify your steps. For example, you may quickly type and run in the console ?functionName to open a help file for the function or dim(Object) to check the dimensions of the Object in your R environment before you start applying a certain function to that Object. However, you should save most other steps you execute in R in the script, and then you can improve, share, and reproduce your results.

    • 1.4: Functions and Packages

      Functions are the workhorses of your analysis, data manipulation, or visualization in R. You are going to use R functions all the time. Here you will learn about function arguments and how to get help for a specific function and load more functions in the form of a package.

    • 1.5: Management of Code and Other Files

      This section suggests ways to optimize your work on a project. You will enjoy coding more after you develop habits of saving your analysis as R scripts, adding sections and sufficient comments to your code, and organizing project files for efficient work with the data, analysis outputs, code files, and other related documents.

    • Unit 1 Assessment

      • Receive a grade