Let’s say I have a data set that includes a column of answers to a question “What days of the week are you most likely to eat steak?”. The answers provided are [1] “Friday”, [2] “Wednesday”, [3] “Friday, Saturday, Sunday", [4] "Saturday”, [5] “Sat, Sun”, [6] “Th, F, Sa” How can I tell R to count “Friday, Saturday, Sunday”, “Sat, Sun”, and “Th, F, Sa” as three separate entries for each unique observation? And is there a way to simultaneously tell R that, for example, “Friday” is the same as “Fri” or “F”; “Saturday” is the same as “Sat” or “Sa”; etc.? Thanks for your assistance.
-- View this message in context: http://r.789695.n4.nabble.com/help-with-text-patterns-in-strings-tp4669714.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.