2
2
title : " Data within VDAT files"
3
3
output : rmarkdown::html_vignette
4
4
vignette : >
5
- %\VignetteIndexEntry{Data within VDAT files}
5
+ %\VignetteIndexEntry{Data within VDAT files}
6
6
%\VignetteEngine{knitr::rmarkdown}
7
7
%\VignetteEncoding{UTF-8}
8
8
---
9
-
9
+
10
10
``` {r, include = FALSE}
11
11
knitr::opts_chunk$set(
12
- collapse = TRUE,
13
- comment = "#>"
12
+ collapse = TRUE,
13
+ comment = "#>"
14
14
)
15
15
```
16
16
@@ -29,12 +29,14 @@ The table below shows each receiver/VDAT type along with, in alphabetical order,
29
29
``` {r, echo=FALSE, message=FALSE}
30
30
source("../tests/testthat/setup-testfiles.R")
31
31
32
- for (i in seq_along(testfiles)) {
33
- vdat_to_csv(testfiles[i],
34
- outdir = td,
35
- quiet = TRUE
36
- )
37
- }
32
+ suppressMessages(
33
+ for (i in seq_along(testfiles)) {
34
+ vdat_to_csv(testfiles[i],
35
+ outdir = td,
36
+ quiet = TRUE
37
+ )
38
+ }
39
+ )
38
40
39
41
exported_csvs <- lapply(
40
42
list.files(td, pattern = "\\.csv$", full.names = T),
@@ -45,16 +47,16 @@ exported_csvs <- lapply(
45
47
names(exported_csvs) <- list.files(td, pattern = "\\.v.*$")
46
48
```
47
49
48
- ``` {r, make-data-dictionary, echo=FALSE}
50
+ ``` {r, make-data-dictionary, echo=FALSE, message=FALSE }
49
51
make_key <- function(exported_csv) {
50
52
key <- exported_csv[grepl("_DESC$", exported_csv$V1), ]
51
53
key$V1 <- gsub("_DESC$", "", key$V1)
52
-
54
+
53
55
key <- key |>
54
56
split(~V1, drop = TRUE) |>
55
57
lapply(function(.) .[, colSums(. != "") != 0]) |>
56
58
lapply(`[`, -1)
57
-
59
+
58
60
key
59
61
}
60
62
@@ -84,7 +86,7 @@ data.frame(
84
86
for (receiver_type in seq_along(keys)) {
85
87
## Per file
86
88
n_data_type <- length(keys[[receiver_type]])
87
-
89
+
88
90
md <- paste0(
89
91
"### ",
90
92
names(keys)[receiver_type],
@@ -93,11 +95,11 @@ for (receiver_type in seq_along(keys)) {
93
95
"\n\n"
94
96
)
95
97
cat(md)
96
-
98
+
97
99
for (data_type in seq_along(keys[[receiver_type]])) {
98
100
## per data type
99
101
n_data_col <- length(keys[[receiver_type]][[data_type]])
100
-
102
+
101
103
md <- paste0(
102
104
"#### ",
103
105
names(keys[[receiver_type]])[data_type],
0 commit comments