Skip to contents

About this package

ai.tutorials is a collection of tutorials for learning how to use AI to code in R. It makes extensive use of the tools in the tutorial.helpers package.

Installation

The package is not yet on CRAN.

You can install the development version from GitHub with:

pak::pak("PPBDS/ai.tutorials")

Tutorials

The tutorials cover material from two books: R for Data Science (2e) by Hadley Wickham, Mine Çetinkaya-Rundel, and Garrett Grolemund and Analyzing US Census Data: Methods, Maps, and Models in R by Kyle Walker.

You run the tutorials like so:

learnr::run_tutorial(name = "r4ds-1", 
                     package = "ai.tutorials")

R for Data Science

r4ds stands for R for Data Science. There are five related tutorials in the package: r4ds-1, r4ds-2, r4ds-3, r4ds-4, and r4ds-5. Different tutorials cover different chapters from the book as follows.

r4ds-1

Data import
Data visualization
Data transformations
Data tidying

r4ds-2

Spreadsheets
Layers
Exploratory data analysis
Communication

r4ds-3

Databases
Logical vectors
Numbers
Strings
Regular expressions

r4ds-4

Arrow
Factors
Dates and times
Missing values
Joins

r4ds-5

Hierarchical-data
Web scraping
Functions
Iterations

The organization of the tutorials is not the same as the organization of R4DS. Instead, each tutorial begins by sourcing data from a different sort of storage technology and then working with that data.

Analyzing US Census Data

There is one tutorial which covers material from Analyzing US Census Data: Methods, Maps, and Models in R by Kyle Walker: tidycensus-1. The name of the tutorial comes from the tidycensus package, also written by Walker, and the leading method for working with Census data in R.