Description Usage Arguments Value Examples
Look for cells with multiple people and create separate rows for each person.
1 2 3 4 5 6 | speakerSplit(
dataframe,
person.var = 1,
sep = c("and", "&", ","),
track.reps = FALSE
)
|
dataframe |
A dataframe that contains the person variable. |
person.var |
The person variable to be stretched. |
sep |
The separator(s) to search for and break on. Default is: c("and", "&", ",") |
track.reps |
logical. If |
Returns an expanded dataframe with person variable stretched and accompanying rows repeated.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
DATA$person <- as.character(DATA$person)
DATA$person[c(1, 4, 6)] <- c("greg, sally, & sam",
"greg, sally", "sam and sally")
speakerSplit(DATA)
speakerSplit(DATA, track.reps=TRUE)
DATA$person[c(1, 4, 6)] <- c("greg_sally_sam",
"greg.sally", "sam; sally")
speakerSplit(DATA, sep = c(".", "_", ";"))
DATA <- qdap::DATA #reset DATA
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.