novelName | R Documentation |
Generate a name with a prefix disjoint from a set of names
novelName(prefix, names)
prefix |
character, desired prefix |
names |
character list of names to avoid |
new name disjoint from set of names
# 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.