Description Usage Arguments Value Examples
View source: R/mailGenerator.R
This function allows you to generate a k words email from a specific probability distribution, given the email is spam or not. Each word given the class of the email, is generated from a Bernoulli distribution.
1 2  | mailGenerator(k = 5, spam = T, subsetSpam = matrix(c(1, 0, 0, 0, 0, 1, 1,
  0, 0, 0), nrow = 2, byrow = T), probSubsetSpam = c(0.8, 0.2))
 | 
k | 
 number of words in the email. Defaults is 5.  | 
spam | 
 is the email spam? Defaults to TRUE.  | 
subsetSpam | 
 matrix where each row is a configurations of words 
that have non-zero probability given that the email is spam. 
Defaults is   | 
probSubsetSpam | 
 probability of the configurations in subsetSpam given
the email is spam. The probabilities for the rest of configurations are set
to 0. Defaults is   | 
If spam = T, returns one of the rows of subsetSpam, according to 
the probabilities in probSubsetSopam. 
If spam = F, returns a k words email,
where each configuration is equally probable.
1  | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.