I am doing an assignment with the built-in "SWISS" dataset, and where the value is greater than 50 I need to create a binary variable taking 1
I have a feeling that I might have to use the subset command, but I am lost as how to implement it.
I am doing an assignment with the built-in "SWISS" dataset, and where the value is greater than 50 I need to create a binary variable taking 1
I have a feeling that I might have to use the subset command, but I am lost as how to implement it.
using dplyr
swiss %>%
mutate(aggGreaterThan50 = (Agriculture > 50) * 1)