Description Usage Arguments Value Examples
Generate a name with a prefix disjoint from a set of names
1 |
prefix |
character, desired prefix |
names |
character list of names to avoid |
new name disjoint from set of names
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # basic op
novelName('b', c('a', 'b', 'c'))
# complex application (converting logistic
# links to probabilities).
d <- data.frame(
exampleId = c(1, 1, 2, 2),
resultLabel = c('a', 'b' , 'a', 'b'),
linkValue = c(-5, 2, -2, -1),
stringsAsFactors = FALSE)
totColName <- novelName('t', colnames(d))
d ->.;
mutate_se(., c(totColName := "exp(linkValue)")) ->.;
group_by_se(., "exampleId") ->.;
mutate_se(., c("probability" :=
paste0(totColName, '/sum(', totColName, ')'))) ->.;
deselect(., totColName)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.