Chapter 1. A Simple Guide to R

In this chapter, we will cover the following recipes:

  • Installing packages and getting help in R
  • Data types in R
  • Special values in R
  • Matrices in R
  • Editing a matrix in R
  • Data frames in R
  • Editing a data frame in R
  • Importing data in R
  • Exporting data in R
  • Writing a function in R
  • Writing if else statements in R
  • Basic loops in R
  • Nested loops in R
  • The apply, lapply, sapply, and tapply functions
  • Using par to beautify a plot in R
  • Saving plots

Installing packages and getting help in R

If you are a new user and have never launched R, you must definitely start the learning process by understanding the use of install.packages(), library(), and getting help in R. R comes loaded with some basic packages, but the R community is rapidly growing and ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.