-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path80-example-05.Rmd
27 lines (19 loc) · 920 Bytes
/
80-example-05.Rmd
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
# Donors who aren't degreeholders {#ex-sim-donors}
```{r ex-sim-donors-loadlib, message = FALSE}
# i always begin by loading the disco engine if it isn't already loaded
library(discoveryengine)
```
We have what looks like an easy request:
> Find donors to the School of Information who are not SIM degree holders.
Having already looked up the codes, you immediately think:
```{r eval = FALSE}
gave_to_area(SIM) %but_not% has_degree_from(LI)
```
Unfortunately, as you begin reviewing the results, you notice that you produced a list that includes spouses of degree holders who received credit for household gifts to SIM.
To get around the issue, use the `married_to` widget (a [higher-order widget](#higher-order-widgets)). Note the use of parentheses to ensure the correct interpretation:
```{r}
alum = has_degree_from(LI)
non_alum_donor =
gave_to_area(SIM) %but_not%
(alum %or% married_to(alum))
```