B Cheat Sheet

If you’re looking for help installing the discovery engine, head over to the installation guide. If you’ve previously installed the discovery engine, but need to update to the latest version, check the instructions for updating.

B.1 General

  • Always start a session with library(discoveryengine)
library(discoveryengine)
  • Use show_widgets() for help finding the right widget.
  • When in doubt, use the brainstorm bot. For instance if you are looking for people who played on the basketball team, type brainstorm_bot("basketball")
  • Multiple widgets can be combined using the operators %and%, %or%, or %but_not%.
  • Be aware of the add-on packages for outputting additional data and improving your disco engine experience.
  • Use the documentation. For instance, type ?has_affiliation to understand how to use the has_affiliation widget.

B.2 Output

Use display for output. Recall that you can use the equals sign = to assign names to your disco engine definitions, to make it easier to refer to them when displaying or doing other operations:

basketball_player = played_sport(basketball_men, basketball_women)
display(basketball_player)
## # A tibble: 489 x 1
##    entity_id
##        <dbl>
##  1       370
##  2      1495
##  3      3615
##  4      4425
##  5      5946
##  6      6412
##  7      6882
##  8      7539
##  9      8283
## 10      8328
## # … with 479 more rows

If instead of just viewing IDs on the screen, you’d like to export them (perhaps to use in a CADS savedlist), just add a filename: display(basketball_player, file = "basketball-players") and a file called “basketball-players.csv” will appear in your working directory. Note that the exported file has a header, so when you upload it to an Advance savedlist, make sure to check the “First row is a header” box.

B.3 Code lookup

Most widgets rely on the coding found in CADS for their input, but you probably haven’t memorized all of the codes! By using a question-mark inside of a widget, you can do look-ups on the fly:

gave_to_department(?band)
## Regular codes and synonyms:
##   synonym    code
##  cal_band CALBAND
## 
## Defunct codes and synonyms:
##    synonym code
##  .cal_band  BAY

Codes (such as CALBAND) and synonyms (such as cal_band) can be used interchangeably, so use whichever feels more comfortable.

B.5 Other

Type show_suspect_pools() to view a list of all Suspect Pools, which is useful in conjunction with the in_suspect_pool widget.