Description Usage Arguments Value Examples
Split a factor level based on another factor in a data.frame. If you want to split a factor level based on a numerical variable, first create a new factor level corresponding to the conditioning of your numerical variable, then use 'splitlevel' to create a factor with the split level.Look at the examples in the vignette for usage.
1 2 | splitlevel(data, splitfactor, splitlev, factorby,
newfactorname = "splitfactor")
|
data |
Input data-frame |
splitfactor |
Factor to be split |
splitlev |
The level in this factor to be split |
factorby |
The factor on which to split based on |
newfactorname |
The name of the new split factor level |
data.frame
1 2 | x <- data.frame(first = c(1:20), second = rep(c("A","B"), each = 10), third = rep_len(c("W","X","Y","Z"), 20))
splitlevel(x,"second","A","third", "callitwhatyouwant")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.