-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Rmd
More file actions
95 lines (68 loc) · 2.16 KB
/
Copy pathREADME.Rmd
File metadata and controls
95 lines (68 loc) · 2.16 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
---
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%"
)
```
# cram
<!-- badges: start -->
[](#)
<!-- badges: end -->
The goal of cram is to process output from the Lynker CRAM model.
## Installation
You can install the development version of cram from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("Lynker-Tech/cram")
```
## Example
This is a basic example which shows you how to solve a common problem:
```{r parse_example}
library(cram)
base_folder <- "D:/downloads/runs/2049 v0.469 0.13/"
## basic example code
models <- cram::parse_directory(base_folder)
models
```
Now that we've located the model directory, we can use the `process_cram()` function to process the output sheets within the model directory
```{r proc_cram_ex}
cram1 <- cram::process_cram(
model_directory = models[1, ],
return_wide = TRUE
)
head(cram1, 15)
```
<br>
We can also build a lookup table for the output sheets in the model directory using the `lookup_table()` function
```{r lookup_ex}
lookup_df <- cram::lookup_table(
model_directory = models[1, ]
)
head(lookup_df, 15)
```
<br>
We can identify the variables in one of processed CRAM output sheets
```{r}
output_variables <- find_variables(
df = cram1
)
head(output_variables, 15)
```
Identify available variables using `find_variables()`, and use `plot_cram()` to plot a set of variables for multiple model scenarios after processing CRAM output sheets using `process_cram() `
```{r}
# Plot specific variables for CRAM model runs
cram_plot <- plot_cram(
cram_df = cram1,
plot_vars = output_variables$names[17:19],
start = "2004-01-01",
end = "2007-01-01",
wrap = FALSE
)
cram_plot
```