-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathREADME.Rmd
68 lines (57 loc) · 2.17 KB
/
README.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
64
65
66
67
68
---
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%",
eval = FALSE
)
```
# hakedataUSA
<!-- badges: start -->
<!-- badges: end -->
The goal of {hakedataUSA} is to provide code to extract and workup the U.S. data
for the assessment of Pacific Hake.
## Instructions
1. First, you must update `data-raw/quotas.csv` to include the sector-specific
quotas. These values are used when processing the data, mainly for the
creation of figures. Then, from within R, source `data-raw/quotas.R` and the
internal data object will be updated and ready for use. Commit both
`data-raw/quotas.csv` and `data-quotas.rda` to the repository and push.
1. Next, load the package. This can be accomplished through GitHub (first
chunk) or using a local clone (second chunk).
```{r installation-github}
chooseCRANmirror(ind = 1)
# install.packages("pak")
pak::pak("pacific-hake/hakedataUSA")
library(hakedataUSA)
```
```{r installation-local}
chooseCRANmirror(ind = 1)
stopifnot(basename(getwd()) == "hakedataUSA")
devtools::load_all()
```
1. The path to where all of the raw output will be saved is stored in an
internal function, i.e., `hakedata_wd()`. Try it out, see if it works for
you. If it does not work, then you will need to alter the function, which is
stored in `R/hakedata-R`. The function should result in a path ending with
`data-tables` inside of your cloned version of
[pacific-hake/hake-assessment][hake-assessment].
1. The remainder of the code will pull from the data bases and set up the input
files.
```{r execute}
pull_database()
process_database()
write_bridging(
dir_input = fs::path(dirname(hakedata_wd()), "models", "2022.01.10_base"),
dir_output = fs::path(dirname(hakedata_wd()), "models", "2023", "01-version", "02-bridging-models")
)
```
## Issues
Please contact [email protected] if there are issues with the code.
Note that the databases will only be accessible to U.S. members of the JTC.
[hake-assessment]: www.github.com/pacific-hake/hake-assessment