-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_main.tex
4057 lines (3356 loc) · 173 KB
/
_main.tex
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[]{book}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else % if luatex or xelatex
\ifxetex
\usepackage{mathspec}
\else
\usepackage{fontspec}
\fi
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\usepackage[margin=1in]{geometry}
\usepackage{hyperref}
\hypersetup{unicode=true,
pdftitle={Documentation for the discoveryengine},
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\usepackage{natbib}
\bibliographystyle{plainnat}
\usepackage{color}
\usepackage{fancyvrb}
\newcommand{\VerbBar}{|}
\newcommand{\VERB}{\Verb[commandchars=\\\{\}]}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% Add ',fontsize=\small' for more characters per line
\usepackage{framed}
\definecolor{shadecolor}{RGB}{248,248,248}
\newenvironment{Shaded}{\begin{snugshade}}{\end{snugshade}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{0.94,0.16,0.16}{#1}}
\newcommand{\AnnotationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\AttributeTok}[1]{\textcolor[rgb]{0.77,0.63,0.00}{#1}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\BuiltInTok}[1]{#1}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\CommentVarTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ConstantTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ControlFlowTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{#1}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\DocumentationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{0.64,0.00,0.00}{\textbf{#1}}}
\newcommand{\ExtensionTok}[1]{#1}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.00,0.00,0.81}{#1}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\ImportTok}[1]{#1}
\newcommand{\InformationTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.13,0.29,0.53}{\textbf{#1}}}
\newcommand{\NormalTok}[1]{#1}
\newcommand{\OperatorTok}[1]{\textcolor[rgb]{0.81,0.36,0.00}{\textbf{#1}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{#1}}
\newcommand{\PreprocessorTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textit{#1}}}
\newcommand{\RegionMarkerTok}[1]{#1}
\newcommand{\SpecialCharTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\SpecialStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\VariableTok}[1]{\textcolor[rgb]{0.00,0.00,0.00}{#1}}
\newcommand{\VerbatimStringTok}[1]{\textcolor[rgb]{0.31,0.60,0.02}{#1}}
\newcommand{\WarningTok}[1]{\textcolor[rgb]{0.56,0.35,0.01}{\textbf{\textit{#1}}}}
\usepackage{longtable,booktabs}
\usepackage{graphicx,grffile}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}
}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
%%% Use protect on footnotes to avoid problems with footnotes in titles
\let\rmarkdownfootnote\footnote%
\def\footnote{\protect\rmarkdownfootnote}
%%% Change title format to be more compact
\usepackage{titling}
% Create subtitle command for use in maketitle
\newcommand{\subtitle}[1]{
\posttitle{
\begin{center}\large#1\end{center}
}
}
\setlength{\droptitle}{-2em}
\title{Documentation for the discoveryengine}
\pretitle{\vspace{\droptitle}\centering\huge}
\posttitle{\par}
\author{}
\preauthor{}\postauthor{}
\date{}
\predate{}\postdate{}
\usepackage{booktabs}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{1}
\tableofcontents
}
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{knitr}\OperatorTok{::}\NormalTok{opts_chunk}\OperatorTok{$}\KeywordTok{set}\NormalTok{(}\DataTypeTok{warning =} \OtherTok{FALSE}\NormalTok{, }\DataTypeTok{message =} \OtherTok{FALSE}\NormalTok{, }\DataTypeTok{fig.path =} \StringTok{"images/"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\hypertarget{welcome}{%
\chapter{Welcome}\label{welcome}}
\begin{figure}
\centering
\includegraphics{images/disco.gif}
\caption{\href{https://www.youtube.com/watch?v=uxi73RQlLB8}{Did I mention that I like to dance?}}
\end{figure}
Welcome to the introduction to and extended documentation for the discoveryengine! The discoveryengine, also known as ``Disco Engine'' or just ``Disco,'' is a tool enabling Prospect Development staff to do custom prospecting, written in the R programming language. For more information, see \protect\hyperlink{what-is-disco}{What is the Disco Engine?}
If you are already familiar with the Disco Engine, and looking for some quick tips to refresh your memory, check out the \protect\hyperlink{cheat-sheet}{cheat sheet}.
Though the Disco Engine is written in R, you don't need to have any experience using R in order to get started. That said, if you're brand new to R and RStudio, check out our brief \protect\hyperlink{r-intro}{introduction to R and RStudio}.
Otherwise, feel free to read this document in order, or to jump around or just bookmark it and refer to it as needed. You may find the search feature helpful, you can access it by clicking on the little magnifying glass at the top of the screen.
\hypertarget{contribute-to-the-disco-engine}{%
\section{Contribute to the Disco Engine}\label{contribute-to-the-disco-engine}}
The Disco Engine is a tool made by and for Prospect Development. If you see something that doesn't work correctly, or documentation that could be made clearer, or a widget that would be useful that isn't implemented, or anything at all that could be improved in the Disco Engine, please submit an issue by clicking on the green ``New Issue'' button on the \href{https://github.com/tarakc02/discoveryengine/issues}{Disco engine issues page}.
\hypertarget{contribute-to-this-documentation}{%
\section{Contribute to this documentation}\label{contribute-to-this-documentation}}
This site is a work in progress. One way you can help is to report any mistakes you find (typos, spelling mistakes, grammatical errors) or any areas that could be explained better (if something was not clear to you, there's a good chance it won't be clear to others either). This documentation site has its own \href{https://github.com/tarakc02/discodocs/issues}{Disco-docs issues page} -- click on the green ``New Issue'' button and enter a short message explaining what's wrong. If you'd like to suggest edits directly, you can do so by clicking on the pen-and-paper icon at the top of any page on this site (guide coming soon). Thank you!
\hypertarget{part-preliminaries}{%
\part{Preliminaries}\label{part-preliminaries}}
\hypertarget{what-is-disco}{%
\chapter{What is the Disco Engine?}\label{what-is-disco}}
If you happen to have an APRA account, this \href{http://connections.aprahome.org/blog/building-the-discovery-engine}{article in APRA Connections magazine} is a good introduction. If you don't have an APRA account, then read on . . .
The Discovery Engine, or Disco Engine, is a prospecting tool that empowers Prospect Development staff to precisely define (and pull together) constitutencies for their fundraising clients. It does so by providing two complementary resources: a \emph{vocabulary and grammar} for specifying constituencies, and tools to facilitate \emph{discovery} of constituencies.
\hypertarget{vocabulary-and-grammar}{%
\section{Vocabulary and Grammar}\label{vocabulary-and-grammar}}
The Disco Engine is based on the idea that a constituency can be defined using one or more \emph{predicates} (such as ``majored in math'' or ``attended a Discover Cal event''), where multiple predicates are combined using ``and'', ``or'', or ``but not.'' To illustrate, here is a sample constituency definition for the department of mathematics:
\begin{quote}
\emph{majored in mathematics} \textbf{or} \emph{has given to the math department}
\end{quote}
The constituency is then just any individual who fits the definition.
The most basic tool that the Disco Engine provides is called a \protect\hyperlink{working-with-widgets}{widget}, which is a tool for generating a simple predicate. For instance, the widget \texttt{majored\_in} allows us to build the first part of our example definition:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{majored_in}\NormalTok{(mathematics)}
\end{Highlighting}
\end{Shaded}
Furthermore, the Disco Engine provides the following connectors to \emph{combine} predicates in order to create more complex definitions:
\begin{itemize}
\tightlist
\item
\texttt{\%and\%}
\item
\texttt{\%or\%}
\item
\texttt{\%but\_not\%}
\end{itemize}
So in the language of the Disco Engine, our definition would look like:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{majored_in}\NormalTok{(mathematics) }\OperatorTok{%or%}\StringTok{ }\KeywordTok{gave_to_department}\NormalTok{(mathematics)}
\end{Highlighting}
\end{Shaded}
There is no limit to the number of predicates that can be strung together to form a definition:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{majored_in}\NormalTok{(mathematics) }\OperatorTok{%or%}
\StringTok{ }\KeywordTok{gave_to_department}\NormalTok{(mathematics) }\OperatorTok{%and%}
\StringTok{ }\KeywordTok{lives_in_msa}\NormalTok{(san_francisco)}
\end{Highlighting}
\end{Shaded}
These definitions can quickly become very complex. To manage that complexity, the Disco Engine provides the ability to \emph{assign} names to definitions, that can then be used to construct more complex definitions:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{is_math_constituent =}\StringTok{ }\KeywordTok{majored_in}\NormalTok{(mathematics) }\OperatorTok{%or%}\StringTok{ }
\StringTok{ }\KeywordTok{gave_to_department}\NormalTok{(mathematics)}
\NormalTok{local_math_constituent =}\StringTok{ }\NormalTok{is_math_constituent }\OperatorTok{%and%}
\StringTok{ }\KeywordTok{lives_in_msa}\NormalTok{(san_francisco)}
\NormalTok{parent_of_local_math_constituent =}\StringTok{ }\KeywordTok{parent_of}\NormalTok{(local_math_constituent)}
\end{Highlighting}
\end{Shaded}
Together, the collection of predicates, the logical operators, and the ability to assign names form an expressive language for describing custom constituencies for a variety of purposes. Best of all, the Disco Engine gives us the ability to pull the IDs of a defined constituency from the database!
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{display}\NormalTok{(parent_of_local_math_constituent)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 561 x 1
## entity_id
## <dbl>
## 1 1168
## 2 4522
## 3 6322
## 4 6326
## 5 7644
## 6 11512
## 7 23989
## 8 24151
## 9 24247
## 10 26492
## # … with 551 more rows
\end{verbatim}
\hypertarget{facilitating-discovery}{%
\section{Facilitating discovery}\label{facilitating-discovery}}
Having a clear language for prospecting and defining constituencies is nice, but Prospect Development is increasingly being asked to do affinity-based prospecting, which often involves defining new constituencies that don't have clear-cut coding associated with them yet, or digging into student activity, interest, affiliation, and other codes to figure out which ones might fit the constituency to be defined. That need motivates the Disco Engine's bots, such as the \protect\hyperlink{brainstorm-bot}{brainstorm bot} and the \protect\hyperlink{matrix-bot}{matrix bot}. We've already seen examples of using predicates to find individuals, but bots allow us to search for predicates.
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{brainstorm_bot}\NormalTok{(}\StringTok{"robot*"}\NormalTok{, }\StringTok{"artificial intelligence"}\NormalTok{, }\StringTok{"AI"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## attended_event
## 8760: Robots on the Edge:Intelligent Machines
## 9139: AI Energy Alumni Panel & Firm Night
## 8759: Fireside Chat w/Tom Siebel: AI and IoT
## 9141: AI Business Behaving Well: Social Resp.
## 9361: Inclusive AI: Technology and Policy
## 9140: AI Career Coach Information Session
## 6724: Haas East Bay Chp Robotic Event 06-18-14
## 9325: BARS 2017: Bay Area Robotics Symposium
## 9136: AI Getting Smart about Start-Ups
## 9497: Putting AI to Work: Tech & Policy
## 9498: WIT: Future of AI
## 8761: Silicon Valley Forum: Medical Robotics
## 9147: AI Coaching with Niandong Wang MBA '04
## 9280: AL SD Content AI Impact on Life
## 9431: SVF: Robots on the Edge
## 9138: AI Learn how to Write a Powerful Resume
## attended_hs
## 471828: Cb-Ai Operations S&L
## fec_gave_to_committee
## C00596908: ROBOTECHNOLOGY INC C.R.
## C00521765: LIQUID ROBOTICS INC POLITICAL ACTION COMMITTEE (LIQUID ROBOTICS PAC)
## C00144261: APPRAISAL INSTITUTE PAC (AI PAC)
## C00717249: RALLY ROBOT ZAPS AOC
## C00582767: CAMPAIGN FOR A FEDERAL ROBOTICS COMMISSION
## C00635748: AI PAC
## C00717074: RALLY ROBOT 2020
## has_interest
## AIN: Artificial Intelligence
## ROB: Robotics
## participated_in
## UROB: Robotmedia Presents
## RENY: Robotics & Engineering for Youth
## ENRO: Cal Robotics
## sec_filed
## 1409269: Restoration Robotics, Inc.
## 1528557: Corindus Vascular Robotics, Inc.
## 1409269: Restoration Robotics Inc
\end{verbatim}
\hypertarget{r-intro}{%
\chapter{Introduction to R and RStudio}\label{r-intro}}
The discoveryengine works best when used with RStudio. Watch this video for a quick tour around RStudio:
\hypertarget{installation}{%
\chapter{Installation}\label{installation}}
Discoveryengine (and all packages we use in Prospect Developmemt) is installed on the R drive. The most important step to make sure you can access these packages is to set up your default library path to the shared packages repository.
Run a quick test to see your current library path:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{.libPaths}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
The first result returned should be "\\\\ur2.urel.berkeley.edu/ur_unitshares/Prospect Development/Prospect Analysis/pd-shared-r-packages". If it's not, follow the steps below to change your default library path.
Step 1: Open a new RStudio session and run the following script:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# the first part sets up the new package directory}
\NormalTok{package_dir <-}\StringTok{ "\\\\ur2.urel.berkeley.edu/ur_unitshares/Prospect Development/Prospect Analysis/pd-shared-r-packages"}
\ControlFlowTok{if}\NormalTok{ (}\OperatorTok{!}\KeywordTok{dir.exists}\NormalTok{(package_dir)) }\KeywordTok{dir.create}\NormalTok{(package_dir, }\DataTypeTok{recursive =} \OtherTok{TRUE}\NormalTok{)}
\CommentTok{# then make a configuration file that notifies R of the new package directory}
\CommentTok{# change [username] to your actual username in your P drive - usually your last name followed by your first initial}
\ControlFlowTok{if}\NormalTok{ (}\OperatorTok{!}\KeywordTok{file.exists}\NormalTok{(env_file)) }\KeywordTok{file.create}\NormalTok{(env_file)}
\NormalTok{env_file <-}\StringTok{ "\\ur2.urel.berkeley.edu\UR_USERS\[username]"}
\CommentTok{# and add the new location to the configuration file}
\KeywordTok{cat}\NormalTok{(}\StringTok{"}\CharTok{\textbackslash{}n}\StringTok{R_LIBS_USER='"}\NormalTok{, package_dir, }\StringTok{"'"}\NormalTok{, }
\DataTypeTok{sep =} \StringTok{""}\NormalTok{, }\DataTypeTok{file =}\NormalTok{ env_file, }\DataTypeTok{append =} \OtherTok{TRUE}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
Step 2:
Quit your current RStudio session and open a new one. Try running the following test again:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{.libPaths}\NormalTok{()}
\end{Highlighting}
\end{Shaded}
If the PD shared packages depository is returned, you are ready to start using Disco Engine. If not, contact the Analytics Team to troubleshoot your situation.
\hypertarget{before-you-continue}{%
\section{Before you continue}\label{before-you-continue}}
At this point, you should have already:
- tested your CDW connection
- run a test query
If you haven't completed all of those items, head over to section \protect\hyperlink{test-cdw}{Test CDW} and complete those steps, and then return here.
\hypertarget{a-disco-test}{%
\section{A disco test}\label{a-disco-test}}
In order to make sure everything is working properly, we'll run a quick disco test:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# you'll always load the discoveryengine package before doing anything else}
\KeywordTok{library}\NormalTok{(discoveryengine)}
\CommentTok{# make sure we can create a disco definition}
\NormalTok{high_cap =}\StringTok{ }\KeywordTok{has_capacity}\NormalTok{(}\DecValTok{1}\NormalTok{)}
\CommentTok{# make sure that things print properly}
\NormalTok{high_cap}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## LISTBUILDER DEFINITION (type: entity_id)
## . source: d_entity_mv.entity_id (entity_id)
## . logic: capacity_rating_code IN (1)
\end{verbatim}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# make sure we can send the definition to the data warehouse}
\KeywordTok{display}\NormalTok{(high_cap)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 298 x 1
## entity_id
## <dbl>
## 1 1969
## 2 3105
## 3 3422
## 4 7011
## 5 7644
## 6 12178
## 7 12453
## 8 17464
## 9 18139
## 10 20125
## # … with 288 more rows
\end{verbatim}
If you got this far without any problems, then congrats! You are a disco dancer!
\hypertarget{part-basics}{%
\part{Basics}\label{part-basics}}
\hypertarget{intro-example}{%
\chapter{An introductory example}\label{intro-example}}
Before diving in to details, let's work through a simple real-life example. We'll explain the functions used in more detail in later sections, but here you can see what the tool looks like in action.
Here is our scenario: A fundraiser just called, and is trying to organize an event in San Francisco that will feature a well-known technologist. She wants you to help her find prospects to invite to the event. We start out by loading the discoveryengine:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{library}\NormalTok{(discoveryengine)}
\end{Highlighting}
\end{Shaded}
\hypertarget{develop-a-strategy}{%
\section{Develop a strategy}\label{develop-a-strategy}}
You might already be thinking of what sorts of prospects we should look for. That's good! There are countless ways to respond to this request, and you'll have to rely on your own expertise in order to know who to include on a potential invite list. For this example, I'll use the following definition of a good prospect:
\begin{itemize}
\tightlist
\item
has demonstrated an interest in technology, and \ldots{}
\item
lives or works in/near San Francisco
\end{itemize}
Note that we now have a pretty clear idea of who to look for, but we need more precision. For instance, what constitutes a ``demonstrated interest in technology?'' What does it mean to be ``in/near San Francisco?'' In day-to-day conversations, we don't necessarily need that level of precision to understand one another, but since we'll need to translate this request into language a computer can understand, the more precision the better. I'll define a ``demonstrated interest in technology'' as having either an interest code or a philanthropic affinity related to technology, and ``in/near San Francisco'' as anywhere that falls into the San Francisco Metropolitan Statistical Area (MSA).
\hypertarget{intro-example-create-def}{%
\section{Create the definition}\label{intro-example-create-def}}
So now that we have a precise idea of who we want to find, we can create a definition that the computer will understand. This is important, since our computer is the only link we have to the CADS Data Warehouse. We can give it a precise definition in a language that it understands, and it will then relay our request to the CADS Data Warehouse. The CADS data warehouse can then search for people who meet our definition, and send them back to the computer, which will then display the list to us.
Ideally, our definition would look like this: \texttt{has\_tech\_interest\ \%and\%\ is\_in\_sf}. Of course, we haven't defined those pieces yet, so just typing that in will result in an error
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{has_tech_interest }\OperatorTok{%and%}\StringTok{ }\NormalTok{is_in_sf}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Error in operate(block1, block2, "intersect"): object 'has_tech_interest' not found
\end{verbatim}
But still we've made progress. We broke a big problem (``define a prospect for this SF tech event'') into two smaller problems (``define having a tech interest'' and ``define being in San Francisco''). Let's tackle each of these one by one. We start by defining \texttt{has\_tech\_interest}. Recall that we decided to use interest codes and philanthropic affinities here. I happen to already know that there is an interest code for ``technology'', but I'm less familiar with the philanthropic affinities area. So I'll use the search feature that is built into most widgets, accessed by entering a question mark followed by a search term into the widget:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{has_philanthropic_affinity}\NormalTok{(?tech)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Regular codes and synonyms:
## synonym code
## science_technology ST
\end{verbatim}
Ah, ok. I can use either the code \texttt{ST} or the synonym \texttt{science\_technology}.
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{has_tech_interest =}\StringTok{ }\KeywordTok{has_interest}\NormalTok{(technology) }\OperatorTok{%or%}
\StringTok{ }\KeywordTok{has_philanthropic_affinity}\NormalTok{(science_technology)}
\end{Highlighting}
\end{Shaded}
We use \texttt{\%or\%} as the connector here because we're interested in anyone who has either one of these characteristics. We now move to defining \texttt{is\_in\_sf}. We'd like to look for anyone who lives or works in San Francisco:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{is_in_sf =}\StringTok{ }\KeywordTok{lives_in_msa}\NormalTok{(san_francisco) }\OperatorTok{%or%}
\StringTok{ }\KeywordTok{works_in_msa}\NormalTok{(san_francisco)}
\end{Highlighting}
\end{Shaded}
We are now able to create our full definition by combining the pieces:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{event_prospect =}\StringTok{ }\NormalTok{has_tech_interest }\OperatorTok{%and%}\StringTok{ }\NormalTok{is_in_sf}
\end{Highlighting}
\end{Shaded}
\hypertarget{send-the-definition-to-the-cdw}{%
\section{Send the definition to the CDW}\label{send-the-definition-to-the-cdw}}
As we discussed in the previous section, now that we have an official definition we can send it to the data warehouse, and see if the data warehouse finds anyone who fits. You can see the definition for yourself by just typing the name of it, though it is now written in a language for the computer to understand and may look intimidating to us humans:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{event_prospect}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## LISTBUILDER DEFINITION (type: entity_id)
## . operator (LS69): intersect
## . left (LS69):
## . . operator (LE58): union all
## . . left (LE58):
## . . . source: d_bio_interest_mv.entity_id (entity_id)
## . . . logic:
## . . . . interest_code IN ('TEC')
## . . . . stop_dt is null
## . . right (LE58):
## . . . source: d_oth_phil_affinity_mv.entity_id (entity_id)
## . . . logic:
## . . . . other_affinity_type IN ('ST')
## . . . . sum(gift_amt) >= 0.0
## . right (LS69):
## . . operator (HZ38): union all
## . . left (HZ38):
## . . . source: d_bio_address_mv.entity_id (entity_id)
## . . . logic:
## . . . . geo_metro_area_code IN ('41860')
## . . . . addr_type_code IN ('H')
## . . . . contact_type_desc IN ('ADDRESS')
## . . . . addr_status_code IN ('A', 'K')
## . . right (HZ38):
## . . . source: d_bio_address_mv.entity_id (entity_id)
## . . . logic:
## . . . . geo_metro_area_code IN ('41860')
## . . . . addr_type_code IN ('B', 'I')
## . . . . contact_type_desc IN ('ADDRESS')
## . . . . addr_status_code IN ('A', 'K')
\end{verbatim}
In order to send the definition to the data warehouse, retrieve the results, and show them to us, we use the \texttt{display} function:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{display}\NormalTok{(event_prospect)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 1,104 x 1
## entity_id
## <dbl>
## 1 529
## 2 616
## 3 3422
## 4 5280
## 5 5573
## 6 5833
## 7 6622
## 8 6886
## 9 7995
## 10 9783
## # … with 1,094 more rows
\end{verbatim}
Of course, we are probably interested in exporting this savedlist to a file, so that we might load it into CADS and run CADSmart reports on it. Conveniently, we can just do that by adding a filename:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{display}\NormalTok{(event_prospect, }\DataTypeTok{file =} \StringTok{"sf-tech-prospects"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
Now when I look over at my working directory, there's a new file called \texttt{sf-tech-prospects.csv}
\hypertarget{working-with-widgets}{%
\chapter{Working with widgets}\label{working-with-widgets}}
So far, we've used widgets in some simple examples. In this section, we'll explore widgets in some more detail. As always, we'll begin by loading the \texttt{discoveryengine}:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{library}\NormalTok{(discoveryengine)}
\end{Highlighting}
\end{Shaded}
\hypertarget{working-with-finding-widgets}{%
\section{Finding widgets}\label{working-with-finding-widgets}}
There are two main ways to find widgets. The first is to use the \texttt{show\_widgets} function. The function takes no arguments. When you run it, an interactive list of widgets, with short descriptions of each, will appear in your viewer window:
\begin{figure}
\centering
\includegraphics{images/show-widgets-employment.png}
\caption{Searching for widgets related to employment data}
\end{figure}
You can browse the entire listing, or use the search bar at the top right to search for specific widgets.
The second way to search for widgets is to use the \texttt{widget\_for} function. This function takes as an argument a search term, and finds all widgets that are related to that search term. For example:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{widget_for}\NormalTok{(}\StringTok{"giving"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## fund_area:
## Find funds with a particular area of giving code (type: allocation_code)
## fund_department:
## Find funds with a particular department code (type: allocation_code)
## fund_miner:
## Entities who gave to funds that match a keyword search (type: entity_id)
## fund_purpose:
## Find funds with a particular fund purpose (type: allocation_code)
## fund_text_contains:
## Funds with notes/biographies that contain the specified search string(s) (type: allocation_code)
## fund_type:
## Find funds with a particular fund type code (type: allocation_code)
## gave_to_area:
## Lists entities who gave to specific areas with minimum giving and specific date range (type: entity_id)
## gave_to_department:
## Lists entities who gave to specific departments with minimum giving and specific date range (type: entity_id)
## gave_to_fund:
## Entities who have given to specified funds (type: entity_id)
## gave_to_fund_type:
## Entities who have given to specific types of funds (type: entity_id)
## gave_to_purpose:
## Find donors to funds with a particular purpose (type: entity_id)
## has_philanthropic_affinity:
## Lists entities with philanthropic affinity(ies) (type: entity_id)
## has_philanthropic_interest:
## Lists entities with philanthropic interest(s) (type: entity_id)
\end{verbatim}
Once you've found the widget you're looking for, you can get additional information using R's built-in help system. Just type a question mark followed by the name of the widget, e.g.~\texttt{?gave\_to\_area}.
\hypertarget{working-with-autocomplete}{%
\section{Leveraging autocomplete}\label{working-with-autocomplete}}
As the previous section illustrates, there are a bewildering number of widgets available in the Discovery Engine. To make them a little easier to navigate, we've attached standard prefixes to the names of groups of widgets with related functionality. Since RStudio's autocomplete pops up suggestions along with documnetation as you type, typing a known prefix is a good way to quickly find and access a widget.
\begin{figure}
\centering
\includegraphics{images/gave-to-autocomplete.png}
\caption{Autocomplete pop up for giving widgets}
\end{figure}
Here are some of the groups of related widgets that use common prefixes in their names:
\begin{itemize}
\tightlist
\item
Giving-related widgets: To find donors to the College of Natural Resources, you'd use \texttt{gave\_to\_area}. To find donors to scholarships, use \texttt{gave\_to\_purpose}. Type \texttt{gave\_to} and wait for a second to see the full list of giving widgets.
\item
Political contribution widgets (federal): Widgets for \protect\hyperlink{ex-fec}{political contributions in federal elections} all begin with the prefix \texttt{fec\_}.
\item
Political contribution widgets (statewide): Widgets for \protect\hyperlink{ex-ca-campaign}{political contributions in California elections} all begin with the prefix \texttt{ca\_}.
\end{itemize}
In addition to entity widgets, \protect\hyperlink{non-entity-widgets}{other types of widgets} are also helpfully grouped together.
\begin{itemize}
\tightlist
\item
Every widget that pulls allocation codes instead of entity IDs begins with \texttt{fund\_} (for example, \texttt{fund\_type} or \texttt{fund\_department}).
\item
Contact report widgets all begin with \texttt{contact\_} (for example \texttt{contact\_text\_contains} or \texttt{contact\_date}).
\item
Proposal-based widgets all begin with \texttt{proposal\_} (for example, \texttt{proposal\_actual\_ask} or \texttt{proposal\_qualified}).
\end{itemize}
Finally, \texttt{bot\_brainstorm} and \texttt{bot\_matrix} are aliases for the \protect\hyperlink{brainstorm-bot}{\texttt{brainstorm\_bot}} and the \protect\hyperlink{matrix-bot}{\texttt{matrix\_bot}}, and in general, typing \texttt{bot\_} and waiting for a second will show a full list of the disco engine's bots.
\hypertarget{working-with-codes-synonyms}{%
\section{Codes and synonyms}\label{working-with-codes-synonyms}}
You may have noticed in previous examples that widgets work with exact codes, such as \texttt{in\_unit\_portfolio(BU)} or with \emph{synonyms}, such as \texttt{in\_unit\_portfolio(business)}. Synonyms will always be in lower-case, and may include any letter of the alphabet or the underscore "\_" character, and nothing else.
Use whichever feels more comfortable -- there is no advantage to using codes vs.~synonyms, though I personally find the synonyms easier to read and understand later on.
\hypertarget{synonym-search}{%
\section{Synonym search}\label{synonym-search}}
If you're not sure of the code or synonym to use, try out the synonym search feature that works with most widgets. Instead of entering a code (\texttt{in\_unit\_portfolio(BU)}) or synonym (\texttt{in\_unit\_portfolio(business)}), enter a question mark followed by a search string:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{in_unit_portfolio}\NormalTok{(?business)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Regular codes and synonyms:
## synonym code
## business BU
\end{verbatim}
You can enter partial terms:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{in_unit_portfolio}\NormalTok{(?sci)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Regular codes and synonyms:
## synonym code
## greater_good_science_center GG
## qb3_quantitative_biosciences QB
## letters_science LS
## lawrence_hall_of_science LH
## neuroscience_institute NS
## letters_and_science LS
## neuroscience NS
## quantitative_bioscience QB
## quantitative_biosciences QB
\end{verbatim}
And even multiple search terms:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{in_unit_portfolio}\NormalTok{(?bus, ?chem, ?public)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Regular codes and synonyms:
## synonym code
## business BU
## chemistry CH
## public_health PH
## public_policy PP
## communications_public_affairs PA
\end{verbatim}
Widgets can always accept multiple codes/synonyms as arguments, and even combinations of the two:
\begin{itemize}
\tightlist
\item
\texttt{gave\_to\_area(business)} would find anyone who has given to the school of Business
\item
\texttt{gave\_to\_area(business,\ chemistry)} would find anyone who has given to Business or to Chemistry
\item
\texttt{gave\_to\_area(HSB,\ COC)} is the same as above
\item
\texttt{gave\_to\_area(business,\ COC)} once again, the same thing
\end{itemize}
\hypertarget{use-defaults}{%
\section{Use the default cases}\label{use-defaults}}
So by now you can probably figure out that \texttt{partcipated\_in(uc\_jazz\_ensembles)} gets you alumni who participated in the UC Jazz Ensembles. But what if you're actually looking for people who particpated in any student activity at all? Would you have to type out all (hundreds!) of them?
Luckily, no! In fact, all you have to do is type \texttt{participated\_in()}:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{did_anything =}\StringTok{ }\KeywordTok{participated_in}\NormalTok{()}
\KeywordTok{display}\NormalTok{(did_anything)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 256,802 x 1
## entity_id
## <dbl>
## 1 3
## 2 4
## 3 5
## 4 7
## 5 9
## 6 15
## 7 16
## 8 18
## 9 22
## 10 28
## # … with 256,792 more rows
\end{verbatim}
That seems a bit magical, doesn't it? The reason that works is because every widget has a defined behavior for when no codes/synonyms are entered. These default behaviors aim to be sensible so that you can use them in an intuitive way. You can always find out exactly what is included in the default by using the help. For instance, by typing \texttt{?has\_capacity} I find out that entering \texttt{has\_capacity()} without any specific ratings will find anyone with a researched capacity rating between 1 and 14 (so 99's are excluded, and those with no capacity ratings are excluded).
\hypertarget{widget-not-operator}{%
\section{\texorpdfstring{The \texttt{not()} operator}{The not() operator}}\label{widget-not-operator}}
Within a widget, you can use \texttt{not} to modify what you're looking for. For example, you can type \texttt{gave\_to\_fund\_type(not(endowment))} to find donors who gave to any kind of fund \textbf{other than} endowment funds. For an example of when this can be useful, see \protect\hyperlink{ex-mba-dual}{the MBA dual-degree holder example}.
\hypertarget{detailed-controls}{%
\section{Detailed controls}\label{detailed-controls}}
We saw above that \texttt{gave\_to\_area(business)} will find people who have given to the Haas School of Business. By default, this will find anyone who has ever given any amount, at any time. But \texttt{gave\_to\_area}, like many widgets, has a number of optional arguments that allow more fine-grained control. For example:
\begin{itemize}
\tightlist
\item
\texttt{gave\_to\_area(business,\ at\_least\ =\ 10000)}: finds anyone who has given at least \$10,000 lifetime to the school of Business.
\item
\texttt{gave\_to\_area(business,\ at\_least\ =\ 10000,\ from\ =\ 20160101)}: finds anyone who has given at least \$10,000 to Business since the beginning of 2016.
\item
\texttt{gave\_to\_area(business,\ at\_least\ =\ 10000,\ from\ =\ 20150101,\ to\ =\ 20151231)}: finds anyone who gave at least \$10,000 to Business between January 1, 2015 and December 31, 2015.
\item
\texttt{gave\_to\_area(business,\ from\ =\ 20150101,\ to\ =\ 20151231)}: finds anyone who gave anything at all to the school of Business between January 1, 2015 and December 31, 2015
\end{itemize}
As you can see, you can pick and choose which optional arguments you want to use. To find out all of the possible controls for a widget, use the built in help. For example, type \texttt{?gave\_to\_area}.
\hypertarget{combining-widgets}{%
\chapter{Combining widgets}\label{combining-widgets}}
As flexible as individual widgets are, they won't help you too much by themselves. What makes them really useful is that they can be combined. There are three ways to combine widgets:
\begin{itemize}
\tightlist
\item
\texttt{\%and\%} will look for entities who satisfy both widgets
\item
\texttt{\%or\%} will look for entities who satisfy at least one of two widgets
\item
\texttt{\%but\_not\%} will look for entities who satisfy a widget but do not satisfy a second widget.
\end{itemize}
Some quick examples:
\texttt{gave\_to\_area(art\_museum)\ \%and\%\ gave\_to\_area(cal\_performances)} finds anyone who has given to \textbf{both} the Art Museum and Cal Performances.
\texttt{gave\_to\_area(art\_museum)\ \%or\%\ gave\_to\_area(cal\_performances)} finds anyone who has ever given to either the Art Museum or to Cal Performances. Note that this would include everyone who was found in the previous (\texttt{\%and\%}) example, as well as those who only gave to one or the other area.
\texttt{gave\_to\_area(art\_museum)\ \%but\_not\%\ gave\_to\_area(cal\_performances)} finds anyone who has given to the Art Museum but has not given to Cal Performances.
\hypertarget{example}{%
\section{Example}\label{example}}
You're working with a major gift officer in the School of Business who is surprised to find out that alumni have been giving \$15,000+ gifts in response to annual appeals, with no follow-up from major gift officers. She calls you up and says:
\begin{quote}
I need to a report on everyone who has given \$15,000 or more this year who isn't yet in a portfolio, and I need it right away!
\end{quote}
You could probably have a savedlist ready before she's even hung up the phone:
\begin{Shaded}
\begin{Highlighting}[]
\NormalTok{important_prospects =}\StringTok{ }
\StringTok{ }\KeywordTok{gave_to_area}\NormalTok{(business, }\DataTypeTok{at_least =} \DecValTok{15000}\NormalTok{, }\DataTypeTok{from =} \DecValTok{20160101}\NormalTok{) }\OperatorTok{%but_not%}\StringTok{ }
\StringTok{ }\KeywordTok{in_unit_portfolio}\NormalTok{(business)}
\KeywordTok{display}\NormalTok{(important_prospects)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 485 x 1
## entity_id
## <dbl>
## 1 2723
## 2 3923
## 3 5355
## 4 5671
## 5 5832
## 6 5833
## 7 8481
## 8 10980
## 9 11346
## 10 12789
## # … with 475 more rows
\end{verbatim}
\hypertarget{part-bots}{%
\part{Bots}\label{part-bots}}
\hypertarget{brainstorm-bot}{%
\chapter{The Brainstorm Bot}\label{brainstorm-bot}}
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# as always, i have to make sure the disco engine is loaded}
\KeywordTok{library}\NormalTok{(discoveryengine)}
\end{Highlighting}
\end{Shaded}
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
\protect\hyperlink{synonym-search}{synonym search feature} because you know which widget to use:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{played_sport}\NormalTok{(?basketball)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## Regular codes and synonyms:
## synonym code
## basketball_men MABB
## cal_basketball_club RSBK
## basketball_women WABB
\end{verbatim}
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:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{brainstorm_bot}\NormalTok{(}\StringTok{"robotics"}\NormalTok{)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## attended_event
## 9325: BARS 2017: Bay Area Robotics Symposium
## 8761: Silicon Valley Forum: Medical Robotics
## fec_gave_to_committee
## C00521765: LIQUID ROBOTICS INC POLITICAL ACTION COMMITTEE (LIQUID ROBOTICS PAC)
## C00582767: CAMPAIGN FOR A FEDERAL ROBOTICS COMMISSION
## has_interest
## ROB: Robotics
## participated_in
## RENY: Robotics & Engineering for Youth
## ENRO: Cal Robotics
## sec_filed
## 1409269: Restoration Robotics, Inc.
## 1528557: Corindus Vascular Robotics, Inc.
## 1409269: Restoration Robotics Inc
\end{verbatim}
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:
\begin{Shaded}
\begin{Highlighting}[]
\KeywordTok{display}\NormalTok{(}\KeywordTok{has_interest}\NormalTok{(ROB))}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 8 x 1
## entity_id
## <dbl>
## 1 24020
## 2 300717
## 3 470691
## 4 824520
## 5 836356
## 6 3104808
## 7 3368828
## 8 3447240
\end{verbatim}
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:
\begin{Shaded}
\begin{Highlighting}[]
\CommentTok{# if i wanted robotics fans in the san francisco MSA}
\NormalTok{prospects =}\StringTok{ }\KeywordTok{brainstorm_bot}\NormalTok{(}\StringTok{"robotics"}\NormalTok{) }\OperatorTok{%and%}
\StringTok{ }\KeywordTok{lives_in_msa}\NormalTok{(san_francisco)}
\KeywordTok{display}\NormalTok{(prospects)}
\end{Highlighting}
\end{Shaded}
\begin{verbatim}
## # A tibble: 37 x 1
## entity_id
## <dbl>
## 1 20288
## 2 290025
## 3 300717
## 4 349805
## 5 391263
## 6 398291
## 7 398320
## 8 415023
## 9 419351
## 10 442491
## # … with 27 more rows
\end{verbatim}
\hypertarget{search-features}{%
\section{Search features}\label{search-features}}