Introduction

This section introduces you to getting your local computer setup.

If you’ve taken an R class before, I highly recommend uninstalling both R and RStudio before starting the below instructions.

Prerequisite: Managing files and folders

Managing your folders and files is a key skill. This page walks you through the major things you should know.

When you save a file, it goes into the hard drive on your computer. This hard drive (called the C:\ on Windows) organizes files into certain locations, called folders.

All modern systems store your files in several folders:

One wrinkle is that Windows often uses OneDrive. OneDrive is an online service that syncs your local files with servers in the Internet. Files are typically still stored on your computer, but are regularly uploaded. So, if you have OneDrive turned on, typically the OneDrive Downloads/Desktop/Documents is the same as the location on your hard drive (usually C:).

Organize your files: link to video on YouTube

Here is a quick guide for organizing your files, slightly more focused on the Mac. link to video on YouTube

Making folders

You should have a folder for our class. Then, create a folder for each week or major project. Store your files inside of this folder.

Make a folder on PC

Right-click in a folder, and choose New folder (or press Control+Shift+N)

link to video on YouTube

Make a folder on Mac

Right-click in a folder, and choose New Folder

link to video on YouTube

Moving files

Avoid modifying any files in your download folder. Instead, download them, and then copy them to the appropriate folder.

Move files on a PC

Guide to using Files Explorer on Windows.

link to video on YouTube

Move files on a Mac

I suggest disabling the Force touch feature:

  • Use the Apple menu to open System Preferences
  • Click Trackpad, the Point & Click tab
  • Turn off Force click and haptic feedback

Right-click on a file, right-click copy, go to the new place, and click paste. Or, move a file by opening a separate Finder window, and dragging/dropping your files.

link to video on YouTube

Other setup

One more thing that would be helpful in our class is to turn on file extensions. This will tell you the hidden information that lives in ever file’s name. So, when you save a Word document as my stuff, it actually is saved as my stuff.docx. The .docx tells the computer to open the file in Word.

As we work with more complex files, you will find that you can not just click on a file to open it in the right program. Instead, get in the habit of opening a program first. Then, inside of the program, open the file (usually by going to the file menu and choosing open).

To turn on:

  • Open Windows Explorer
  • Open View menu
  • Show submenu
  • File Name Extensions

Installing R

RStudio

Do not depend on program state or .RData files! I must be able to run your code as it is submitted in the R file. I strongly suggest closing and re-opening R, and then running all of the code to make sure it works properly.

Shortcuts

There are several vital shortcuts:

  • alt - for <-
  • control s for saving
  • control shift l for linter (always save first!)
  • control enter to run the current line or highlighted section

Application Problem

See problems on GitHub