Repository navigation
Expand file tree
/
Copy pathREADME.Rmd
More file actions
110 lines (69 loc) · 3.37 KB
/
Copy pathREADME.Rmd
File metadata and controls
110 lines (69 loc) · 3.37 KB
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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# rwRtools
<!-- badges: start -->
<!-- badges: end -->
The goal of `rwRtools` is to make it easy to access The Lab's datasets and get started with research.
## What is The Lab?
The Lab is [Robot Wealth's](https://robotwealth.com/) portal for collaborative research.
It is organized around **Research Pods,** which contain data, ideas, research and peer-reviewed edges for a given market question.
For example:
- in the *Equity Factor Research Pod* we look at the question: "*What factors predict the relative performance of stocks in the Russell 1000 index?"*
- In the *Global Risk Premia Research Pod* we look at the question: "*What is the most effective way to get paid for taking on global market risks?* "
## What is the purpose of The Lab?
**The Lab serves three purposes:**
1. It gets you hands-on with the research effort. As well as contributing, you'll learn a ton in the process.
2. It scales the research effort by enabling community contribution.
3. It makes the fruits of that scaled research effort available to the entire Robot Wealth community.
## Install and load
The easiest way to install and load `rwRtools` and its dependencies is via the `pacman` library:
```{r}
if(!require("pacman")) install.packages("pacman")
pacman::p_load_current_gh("RWLab/rwRtools", dependencies = TRUE)
```
## Quickstart: Set up for working on a Research Pod
After installing and loading `rwRtools`, the quickest way to set up a session for working on a particular Research Pod is:
### 1. Authorise to the data library
```{r, eval=FALSE, echo=TRUE}
rwlab_data_auth(oauth_email = "your-email@somewhere.com")
```
`oauth_email` is the email address you use to log in to Robot Wealth's resources.
If called in an interactive session, you will be prompted in a browser to select a Google Identity and copy and paste an authentication code back at the call site.
### 2. List The Lab's Research Pods
```{r}
list_pods()
```
### 3. Load essential Pod data
This transfers price data from the data library to `path` and loads it into the Global Environment as the `prices` object.
**IMPORTANT: It overwrites any object you might have in your Global Environment with that variable name, or locally at `path` with the Research Pod prices file name.**
Requires that you have authorised to the data library prior.
```{r, eval=FALSE, echo=TRUE}
quicksetup(pod = "EquityFactors", path = ".")
prices %>%
head()
```
This transfers the essential data that you always need to `path` (ohlc, metadata), overwriting any existing local Pod objects.
Requires that you've already authorised to the relevant GCS bucket.
### 4. See all data objects associated with a Pod
```{r}
get_pod_meta(pod = "EquityFactors")
```
This outputs a list of all the data objects you can transfer for a Pod.
### 5. Load specific additional Pod data objects
```{r, eval=FALSE, echo=TRUE}
load_lab_object(pod = "EquityFactors", object = "R1000_ohlc_1d.feather", path = ".")
```
This transfers a specifc object to `path`, overwriting any existing local instance of that object.
Requires that you've already authorised to the relevant data library
## Examples
See [the examples](examples/) for more.