[R] help with text patterns in strings

bcrombie bcrombie at utk.edu
Mon Jun 17 19:59:53 CEST 2013

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.

More information about the R-help mailing list