Hello,
I cannot seem to figure out how to extract characters from strings and then use them to fill in rows in a different dataframe. I have a dataframe like
subject string
1 dkid
1 sgua
1 sga
2 cpr
2 bhja
...
and another dataframe that looks like
subject. character. yes/no
1 a NA
1 b NA
1 c NA
1 d NA
...
I am trying to extract the individual characters from every row in the 'string' column of the first dataframe for each subject and figure out whether or not every possible character (from the 'character' column in the second dataframe) is there, i.e., I want to populate the 'yes/no' column based on if the strings from the first dataframe contain the characters from the second dataframe, for each subject.
Any help would be immensely appreciated!