Skip to content

Commit d33d710

Browse files
committed
New render including additional entity for safe outputs
1 parent d460143 commit d33d710

File tree

5 files changed

+212
-158
lines changed

5 files changed

+212
-158
lines changed

README.Rmd

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ conns <- DSI::datashield.login(logins = logindata)
286286
```
287287

288288
###### Simulate some operations
289-
```{r, eval = FALSE}
289+
```{r, eval = TRUE}
290290
## assign data
291291
DSI::datashield.assign.table(conns["study1"],
292292
symbol = "dsROCrate_test",
@@ -336,19 +336,29 @@ NOTE: In the above example, a `path` to store the logs wasn't provided when
336336
calling `dsROCrate::safe_output`, before creating an RO-Crate bag, we should
337337
save the contents of this file first
338338

339-
```{r, eval = FALSE}
339+
```{r, eval = TRUE, warning = FALSE}
340340
logs_entity <- basic_rocrate |>
341341
rocrateR::get_entity(type = "File")
342342
# write file using the path given by `@id`
343+
## write raw logs
343344
writeLines(
344345
logs_entity[[1]]$content[[1]],
345346
file.path("./rocrates", logs_entity[[1]]$`@id`)
346347
)
348+
## write CSV with mappings and executed functions
349+
write.csv(
350+
logs_entity[[2]]$content[[1]],
351+
file.path("./rocrates", logs_entity[[2]]$`@id`),
352+
row.names = FALSE
353+
)
354+
347355
# remove the section `content`
348356
logs_entity[[1]]$content <- NULL
357+
logs_entity[[2]]$content <- NULL
349358
# update the RO-Crate
350359
basic_rocrate <- basic_rocrate |>
351-
rocrateR::add_entity(logs_entity[[1]], overwrite = TRUE)
360+
rocrateR::add_entity(logs_entity[[1]], overwrite = TRUE) |>
361+
rocrateR::add_entity(logs_entity[[2]], overwrite = TRUE)
352362
```
353363

354364
```{r}

0 commit comments

Comments
 (0)