I'm using R for data analysis and I have a string variable that lists the order in which measures were administered in a survey. Here is the string variable for one respondent:
"pimgrwelcomerealstartnamelessTaskinstruct_itemshealth_itemsinstruct_selfsexp_instiat_esteemdebriefing1lastpage"
Is there some way I can use "grepl" to test the order of these measures? For example, can I see if "health_items" came earlier in the string than "instruct_self" (which is true in the string above)? If so, I'd like to create a dummy variable so I can test order effects.
Thanks everyone.