12 Setup: Vector Basics
Purpose: Vectors are the most important object we’ll work with when doing data science. To that end, let’s learn some basics about vectors.
Reading: Programming Basics.
Topics: vectors
Reading Time: ~10 minutes
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✔ ggplot2 3.4.0 ✔ purrr 1.0.1
## ✔ tibble 3.1.8 ✔ dplyr 1.0.10
## ✔ tidyr 1.2.1 ✔ stringr 1.5.0
## ✔ readr 2.1.3 ✔ forcats 0.5.2
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
12.0.1 q1 What single-letter R
function do you use to create vectors with specific entries? Use that function to create a vector with the numbers 1, 2, 3
below.
## [1] 1 2 3
Use the following tests to check your work:
## [1] TRUE
## [1] TRUE
## [1] "Nice!"