Need to create a new variable with conditions from multiple variables

To use reprex, do the following steps:

  1. load the reprex package by using the command library(reprex)
  2. Copy the code you want to run into reprex - don't copy what went to the console. It shouldn't have the > at the beginning of lines, this is just the code. Note you need to include everything including reading in data as the reprex is a standalone session and won't use what is in your environment
  3. Run the command reprex(). This will run whatever you have copied.

This video might be helpful: [Video] Reproducible Examples and the `reprex` package