Willingness to pay by gender

Let's get you started with the subset problem.

install.packages("dplyr")
install.packages("readr")
install.packages("tibble")
wtpmf <- as.tibble(read.csv("full pathname of your csv file here", stringsAsFactors = False)
men <- wtpmf  %>% select(gender, wtp)
women <- wtpmf %>% select(gender,wtp) 

Now, I'm making assumptions about your csv header line, so substitute out gender and wtp for the corresponding fields.

I suspect that you don't really need separate objects by gender, but it will serve as an introduction to some incredibly helpful tools in the tidyverse to make data manipulation much,much easier.

When you've done that (feel free to ask questions if you get stuck), come back and we can talk about how you would apply a test, such as Chi squared on your object. For that discussion, we'll need FAQ: What's a reproducible example (`reprex`) and how do I do one? as pointed out below.