-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path93-cheat-sheet.Rmd
52 lines (33 loc) · 3.03 KB
/
93-cheat-sheet.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
# Cheat Sheet {#cheat-sheet}
If you're looking for help installing the discovery engine, head over to the [installation guide](https://cwolfsonseeley.github.io/discodocs/installation.html). If you've previously installed the discovery engine, but need to update to the latest version, check the [instructions for updating](https://cwolfsonseeley.github.io/discodocs/updating.html).
## General
* Always start a session with `library(discoveryengine)`
```{r cheat-sheet-loadlib}
library(discoveryengine)
```
* Use `show_widgets()` for help [finding the right widget](#working-with-finding-widgets).
* When in doubt, use the [brainstorm bot](#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](#combining-widgets) using the operators `%and%`, `%or%`, or `%but_not%`.
* Be aware of the [add-on packages](#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.
## 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 `display`ing or doing other operations:
```{r cheat-sheet-output-1}
basketball_player = played_sport(basketball_men, basketball_women)
display(basketball_player)
```
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.*
## 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:
```{r cheat-sheet-lookup}
gave_to_department(?band)
```
Codes (such as `CALBAND`) and synonyms (such as `cal_band`) can be used interchangeably, so use whichever feels more comfortable.
## Text search
Though most widgets rely on codes from CADS as inputs, some utilize text search. Just like the `brainstorm_bot`, which is also based on text search, these widgets require you to use quotation marks around the search term(s). Here are some examples:
* `contact_text_contains("neuro*", "brain")`
* `fund_text_contains("diversity")`
* `research_miner("underrepresented")`
**Note:** The `brainstorm_bot` will help you find things through the code tables, but it will not do big text searches of things like contact reports, fund biographies/terms, and research profiles. For that kind of specialized search, you should use these text search based widgets.
## Other
Type `show_suspect_pools()` to view a list of all Suspect Pools, which is useful in conjunction with the `in_suspect_pool` widget.