itemGroupCount: Count customers by permit groups

Description Usage Arguments See Also Examples

Description

Count customers who bought each combination of permits and stamps

Usage

1

Arguments

df

A data frame

See Also

Other analysis functions: calcChurn, calcGenderProportion, calcParticipation, calcRecruitment, countCustomers, countItems, sumRevenue

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Demo data: Count number of customers by combination of items purchased
filterData(
  dataSource = "csv",
  activeFilters = list(
    itemType = c("Fish", "Deer", "Spring Turkey"),
    itemYear = c(2018, 2018)
  )
) %>%
  itemGroupCount()
## Not run: 
# Database connection. Suggest using keyring package to avoid hardcoding
# passwords
myConn <- DBI::dbConnect(odbc::odbc(),
  dsn = "HuntFishApp", # Your datasource name
  uid = keyring::key_get("HuntFishAppUID"), # Your username
  pwd = keyring::key_get("HuntFishAppPWD")
) # Your password

# SQL Backend: Count number of customers by combination of items purchased
filterData(
  dataSource = "sql",
  conn = myConn,
  activeFilters = list(
    itemType = c("Fish", "Deer", "Spring Turkey"),
    itemYear = c(2018, 2018)
  )
) %>%
  itemGroupCount()

## End(Not run)

chrischizinski/huntfishapp documentation built on Sept. 7, 2020, 12:14 p.m.