santa: secret santa function

Description Usage Arguments Note Examples

Description

This function generates random assignments or secret santa and emails the participants if desired.

Usage

1
2
3
santa(p.df, email = FALSE, organizer = NULL, subject = NULL,
  host.nm = "smtp.gmail.com", prt = 465, usr.nm = NULL, pswd = NULL,
  giftLim = 20)

Arguments

p.df

Data frame with information for each individual. Columns need to be 'giver' and 'couple', with 'email' optional. The 'couple' identifies significant others numerically (i.e., spouses have the same number)

email

Logical argument for whether or not participants should automatically be emailed; defaults to FALSE

organizer

If email=TRUE, email address of the organizer

subject

If email=TRUE, subject of the email

host.nm

If email=TRUE, host.name for mailR; defaults to "smtp.gmail.com"

prt

If email=TRUE, smtp port; defaults to 465

usr.nm

If email=TRUE, email username

pswd

If email=TRUE, email/application email

giftLim

If email=TRUE, the gift limit entered just as a number

Note

Sending emails requires installation of the mailR package. If you are using Gmail, the two-factor authentication requires an application password - not your normal account password.

Examples

1
2
3
4
5
6
7
8
9
# A group with two couples and two additional individuals
p.df <- data.frame(giver=LETTERS[1:6],
                   couple=c(1,1,2,2,3,4))
santa(p.df, email=FALSE)

p.df$email <- "tisz1545@colorado.edu"
santa(p.df, email=TRUE, organizer="tim.szewczyk@gmail.com",
      subject="2017 Secret Santa", usr.nm="tim.szewczyk",
      pswd="xxxxxxxxxxxx", giftLim=20)

Sz-Tim/giftR documentation built on May 8, 2019, 8:31 a.m.