I have a dataset with about 2,384 variables but only need to use about 39 of them. I have tried to remove the columns that I am working with into another dataset but I keep getting undefined columns selected error message. Below is the code I wrote:
BR <- BR[, c("id","today_m0","miscarriedwk","p1_status","p2_status","p_status", "p3_status","preg_bl","preg_m6","preg_m12","preg_m18","secedu","married","numchild","numpregnancies","nummiscarriages","numdeliveries","pHIV_bsln","chart_cd4_m0","j8_m0","partnernowsHIV_m0","partnertakesHIV_m0","depression_m0","meanhivstigma_m0","meanpersonalstigma_m0","female_m0","CommstigmaFinal_m0","j12r_m0","PMTCT","ANC","j10_m0","age_m0","intention1year")]