I’m tyring to create new vector in R using an ‘if’ function to pull out only certain values for the new array. Basically, I want to segregate data by day of week for each of several cities. How do I use the apply function to get only, say, Tuesdays in a new array for each city? Thanks
Share
It sounds as though you don’t want
iforapplyat all. The solution is simpler:Suppose that your data frame is
data. Thensubset(data, Weekday == 3)should work.