As in the presentation, we will use stackoverflow_survey_single_response.csv. You should (have) download(ed) the dataset or find it in a folder called data within the folder containing the materials for this workshop.

library (tidyverse)
library (haven)
library(sjlabelled)
library(readr)


stackoverflow_survey_single_response <- read_csv("./data/stackoverflow_survey_single_response.csv")

2

Using base R, create a new object called user_background that contains all variables that assess the respondent characteristics (like age, education, years of coding experience).

The first variable we want to select for our subset is named main_branch, and the last one is years_code_pro. They appear consecutively in the data set. Remember that there are two options for selecting columns in base R: One is subsetting using [ ], the other is the subset() function.

4

Again, using a function from the tidyverse package dplyr, select only the character variables from the stackoverflow_survey_single_response data and assign them to an object named tuesdata_char.
You need to use the selection helper where() for this task.

5

After creating subsets of variables, let’s now rename those variables using dplyr functions again for the tuesdata_person object in one step.

You can also rename variables within the select() command.