Extracting data from csv file help

Hey there, @metalgearrex35! First of all, it is going to be easier for folks around here to help if you include a sample of the data and code you've used to get to where you are stuck. See this post for more information about best practices for writing questions and including a reproducible example (reprex).

But in general, it sounds like you want to select a subset of columns from your whole dataset. The dplyr function for doing that is (intuitively) called, select(). If you want just the Exam2 and diffs columns, you would do this:

exam.data %>%
  mutate(Gender = factor(Gender, levels=1:3,),
         diffs = Final-Exam2) %>%
  select(Exam2, diffs)

As for the other issue regarding the gender variable, it will be easier to help if you include a sample of your data as well as what you expect the output to be.

1 Like