Skip to Tutorial Content

Welcome

Welcome to your first R tutorial!

These tutorials will review information about R content for class meetings and provide exercises for you to practice coding and demonstrate your knowledge.

The tutorials are set to require completion of an exercise before continuing to the next exercise. Also, if you want to clear your answers and start over, click the Start Over link below the topic menu to the left.

Reminders

The last exercise for each tutorial will provide the text that you need to submit to Canvas to get credit for completing the exercises. So don't forget to copy that text over to Canvas each time.

If you find any typos or bugs, let Jeff know. If you have other questions or suggestions, please email Jeff through Canvas.

I hope you enjoy your first tutorial!

Packages

Installing packages from CRAN

Installing packages from CRAN is super easy with RStudio, but it is helpful to know how to do it from the R console.

Installing packages from GitHub

Installing from sources other than CRAN can be a little bit trickier. It is common, for example, for packages to be published on GitHub before they are available on CRAN. The {devtools} package has a install_github() function that easily installs packages from GitHub with just the user name and package name.

Loading packages

Though you can load packages through RStudio, you should know how to do it with a function, so you can include this in scripts.

Wrap-up

Congratulations, you finished your first tutorial! Again, if you found any typos or bugs, email Jeff.

To get credit for this assignment, replace my name with the first name that you submitted in the course introduction form in the code below and click Run Code to generate the text for you to submit to Canvas.

# replace my name below with your first name (surrounded by quotes)
first_name <- "Jeff"
generate_text(first_name)

Assignment complete!

Great! Copy that code into Canvas, and you're all set for this tutorial.

Introduction to R