@@ -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
291291DSI::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
336336calling ` dsROCrate::safe_output ` , before creating an RO-Crate bag, we should
337337save the contents of this file first
338338
339- ``` {r, eval = FALSE}
339+ ``` {r, eval = TRUE, warning = FALSE}
340340logs_entity <- basic_rocrate |>
341341 rocrateR::get_entity(type = "File")
342342# write file using the path given by `@id`
343+ ## write raw logs
343344writeLines(
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`
348356logs_entity[[1]]$content <- NULL
357+ logs_entity[[2]]$content <- NULL
349358# update the RO-Crate
350359basic_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