-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path30-brainstorm-bot.Rmd
52 lines (36 loc) · 1.97 KB
/
30-brainstorm-bot.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# (PART) Bots {-}
# The Brainstorm Bot {#brainstorm-bot}
```{r bb-loadlib}
# as always, i have to make sure the disco engine is loaded
library(discoveryengine)
```
At this point, you're pretty empowered to search through the database for all sorts of prospects, provided you know something about the codes in the database. Even if you don't know the exact code for, say, basketball, you can use the
[synonym search feature](#synonym-search) because you know which widget to use:
```{r bb-find-basketball, cache = TRUE}
played_sport(?basketball)
```
But now imagine someone has asked you for a list of people interested in robotics. Where would that be coded? Perhaps in multiple places? How can you find out?
Enter the brainstorm bot. The brainstorm bot is a robot that is knowledgeable about the code tables in CADS. Let's ask it about robotics:
```{r bb-find-robotics, cache = TRUE}
brainstorm_bot("robotics")
```
Hey brainstorm bot, thanks for the ideas! The results show the name of a widget, along with the codes that are of interest, along with their description from the CADS code tables, so you can decide if they are appropriate for your project. You can then copy and paste to build up the right population:
```{r bb-robotics-interest, cache = TRUE}
display(has_interest(ROB))
```
If it turns out you agree with every one of the brainstorm bot's suggestions, then you don't even have to copy and paste, because (surprise!) the brainstorm bot is actually giving you a fully filled out widget:
```{r bb-robotics-sf, cache = TRUE}
# if i wanted robotics fans in the san francisco MSA
prospects = brainstorm_bot("robotics") %and%
lives_in_msa(san_francisco)
display(prospects)
```
## Search features
The brainstorm bot understands wildcards at the beginning and/or ending of your search term:
```{r bb-find-robotstar, cache = TRUE}
brainstorm_bot("robot*")
```
It also will do multiple searches at once:
```{r bb-robotstar-ds, cache = TRUE}
brainstorm_bot("robot*", "data science")
```