I have a data frame that looks like this:
a <- c("jan", "mar", "jan", "feb", "feb") b <- c("feb", "mar", "mar", "jan", "mar") c <- c("jan", "feb", "feb", "jan", "jan") d <- c("jan", "mar", "jan", "feb", "feb") e <- c("feb", "jan", "feb", "mar", "mar") f <- c("jan", "feb", "feb", "jan", "jan") xxx <- data.frame(a,b,c,d,e,f) xxx
I need to find the location in xxx of each row instance, for example "jan". I can see the hacking solution running through each slot in df and check if it is a "jan", but of course, the right and simple way to do it. Ideally, I would like to get the results returned as a list of coordinates.
Thanks for the help!
search r dataframe
jdfinch3
source share