-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path02-installation.Rmd
63 lines (44 loc) · 2.41 KB
/
02-installation.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
53
54
55
56
57
58
59
60
61
62
63
# Installation {#installation}
Discoveryengine (and all packages we use in Prospect Development) 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:
```{r library_path, eval = FALSE}
.libPaths()
```
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:
```{r set_up_renviron, eval = FALSE}
# the first part sets up the new package directory
package_dir <- "\\\\ur2.urel.berkeley.edu/ur_unitshares/Prospect Development/Prospect Analysis/pd-shared-r-packages"
if (!dir.exists(package_dir)) dir.create(package_dir, recursive = TRUE)
# then make a configuration file that notifies R of the new package directory
# change [username] to your actual username in your P drive - usually your last name followed by your first initial
if (!dir.exists(package_dir)) dir.create(package_dir, recursive = TRUE)
env_file <- "\\ur2.urel.berkeley.edu\UR_USERS\[username]"
# and add the new location to the configuration file
cat("\nR_LIBS_USER='", package_dir, "'",
sep = "", file = env_file, append = TRUE)
```
Step 2:
Quit your current RStudio session and open a new one. Try running the following test again:
```{r library_path2, eval = FALSE}
.libPaths()
```
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.
## 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 [Test CDW](#test-cdw) and complete those steps, and then return here.
## A disco test
In order to make sure everything is working properly, we'll run a quick disco test:
```{r disco_test}
# you'll always load the discoveryengine package before doing anything else
library(discoveryengine)
# make sure we can create a disco definition
high_cap = has_capacity(1)
# make sure that things print properly
high_cap
# make sure we can send the definition to the data warehouse
display(high_cap)
```
If you got this far without any problems, then congrats! You are a disco dancer!