R Under development (unstable) (2024-11-26 r87383 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > { + ## ======================================================== + library(D4TAlink.light) + ## ======================================================== + for(pfun in list(pathsDefault,pathsPMS)) { + ## ============================ + ## set globals + setTaskRoot(tempfile(),dirCreate=TRUE) + #setTaskRoot("~/dtest1",dirCreate=TRUE) + setTaskAuthor("Doe Johns") + setTaskSponsor("MySponsor") + setTaskStructure(pfun) + ## ============================ + ## create first task + tn <- sprintf("%s_myTask",format(Sys.time(),"%Y%m%d")) + task <- initTask("myProject","myPackage",tn) + ## ============================ + ## create a pdf report in first task + file <- pdfReport(task,c("plots",1),dim=c(100,100)) + plot(pi) + dev.off() + if(FALSE) utils::browseURL(file) + ## ============================ + ## create an Excel report in first task + d <- list(letters=data.frame(a=LETTERS,b=letters,c=1:length(letters)), + other=data.frame(a=1:3,b=11:13)) + file <- saveReportXls(d,task,"table") + if(FALSE) utils::browseURL(file) + ## ============================ + ## save an R object report in first task + saveBinary(d,task,"data") + e <- readBinary(task,"data") + if(!all(names(e)%in%names(d))) stop("error [1]") + ## ============================ + ## create an R script for first task + file <- initTaskRscript(task,overwrite=TRUE) + ## ============================ + ## create an R markdown file for first task and render it + initTaskRmd(task,overwrite=TRUE) + file <- renderTaskRmd(task) # requires having run 'tinytex::install_tinytex()' + if(FALSE) utils::browseURL(file) + ## ============================ + ## create an R markdown file for first task with another template and render it + setTaskRmdTemplate("SQU4RE") + initTaskRmd(task,overwrite=TRUE) + file <- renderTaskRmd(task) # requires having run 'tinytex::install_tinytex()' + if(FALSE) utils::browseURL(file) + ## ============================ + ## create an R markdown file for first task with yet another template and render it + file <- tempfile() + file.copy(getTaskRmdTemplate(),file) + setTaskRmdTemplate(file) + initTaskRmd(task,overwrite=TRUE) + file <- renderTaskRmd(task) # requires having run 'tinytex::install_tinytex()' + if(FALSE) utils::browseURL(file) + ## ============================ + ## create a second task; list tasks and files + newtask <- initTask("myProject","myPackage","20220202_otherTask") + testthat::expect_equal(length(listTaskFiles(newtask)$bin),2) + testthat::expect_equal(nrow(listTasks()),2) + ## ============================ + ## archive the first task and delete the first directory + file <- tempfile(fileext=".zip") + archiveTask(task,file) + unlink(getTaskRoot(),recursive=TRUE) + ## ============================ + ## restore the first task into another repository and check it + setTaskRoot(tempfile(),dirCreate=TRUE) + #setTaskRoot("~/dtest2",dirCreate=TRUE) + retask <- restoreTask(file) + print(list.files(getTaskRoot(),recursive=TRUE,full.names=TRUE)) + testthat::expect_equal(retask$task,tn) + ## ============================ + ## delete the second directory + unlink(getTaskRoot(),recursive=TRUE) + } + ## ======================================================== + } Loading required package: jsonlite Loading required package: rmarkdown Loading required package: openssl Linking to: OpenSSL 3.3.0 9 Apr 2024 Loading required package: reticulate Loading required package: feather processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc173883ee4312b.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANpkg\lib\4.5\officedown\examples\bookdown\template.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173887b9c122a/MySponsor/myProject/myPackage/docs/20241127_myTask.docx processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc1738845f87081.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANincoming\R-devel\lib\D4TAlink.light\template\SQU4REtemplate.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173887b9c122a/MySponsor/myProject/myPackage/docs/20241127_myTask.docx updating: word/footer1.xml zip warning: Local Entry CRC does not match CD: word/footer1.xml (deflated 75%) updating: word/header1.xml (deflated 88%) processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc173885a7c74d.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANincoming\R-devel\lib\D4TAlink.light\template\SQU4REtemplate.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173887b9c122a/MySponsor/myProject/myPackage/docs/20241127_myTask.docx updating: word/footer1.xml zip warning: Local Entry CRC does not match CD: word/footer1.xml (deflated 75%) updating: word/header1.xml (deflated 88%) adding: bin/20241127_myTask_data.rds (stored 0%) adding: bin/20241127_myTask_task.json (deflated 81%) adding: bin/20241127_myTask_task.rds (stored 0%) adding: code/20241127_myTask.R (deflated 65%) adding: code/20241127_myTask.Rmd (deflated 58%) adding: data/20241127_myTask_plots-1.pdf (deflated 11%) adding: data/20241127_myTask_table.xlsx (deflated 21%) adding: doc/20241127_myTask.docx (deflated 4%) [1] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/docs/20241127_myTask.docx" [2] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/output/20241127_myTask/20241127_myTask_plots-1.pdf" [3] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/output/20241127_myTask/20241127_myTask_table.xlsx" [4] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/output/20241127_myTask/bin/20241127_myTask_data.rds" [5] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/output/20241127_myTask/bin/20241127_myTask_task.json" [6] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/output/20241127_myTask/bin/20241127_myTask_task.rds" [7] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/progs/20241127_myTask.R" [8] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file17388335c71ad/MySponsor/myProject/myPackage/progs/20241127_myTask.Rmd" processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc1738844374281.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANincoming\R-devel\lib\D4TAlink.light\template\SQU4REtemplate.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173881d542011/PMS_documentation/myProject/myPackage/20241127_myTask/20241127_myTask.docx updating: word/footer1.xml zip warning: Local Entry CRC does not match CD: word/footer1.xml (deflated 75%) updating: word/header1.xml (deflated 88%) processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc17388dd57be0.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANincoming\R-devel\lib\D4TAlink.light\template\SQU4REtemplate.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173881d542011/MySponsor/myProject/myPackage/docs/20241127_myTask.docx updating: word/footer1.xml zip warning: Local Entry CRC does not match CD: word/footer1.xml (deflated 75%) updating: word/header1.xml (deflated 88%) processing file: 20241127_myTask.Rmd output file: 20241127_myTask.knit.md "C:/PROGRA~1/Pandoc/pandoc" +RTS -K512m -RTS 20241127_myTask.knit.md --to docx --from markdown+autolink_bare_uris+tex_math_single_backslash --output pandoc173882c6b5df9.docx --lua-filter "D:\RCompile\CRANpkg\lib\4.5\rmarkdown\rmarkdown\lua\pagebreak.lua" --table-of-contents --toc-depth 3 --highlight-style tango --reference-doc "D:\RCompile\CRANincoming\R-devel\lib\D4TAlink.light\template\SQU4REtemplate.docx" Output created: D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file173881d542011/MySponsor/myProject/myPackage/docs/20241127_myTask.docx updating: word/footer1.xml zip warning: Local Entry CRC does not match CD: word/footer1.xml (deflated 75%) updating: word/header1.xml (deflated 88%) adding: bin/20241127_myTask_task.json (deflated 84%) adding: bin/20241127_myTask_task.rds (stored 0%) adding: code/20241127_myTask.Rmd (deflated 58%) adding: doc/20241127_myTask.docx (deflated 4%) [1] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file1738842e35df5/MySponsor/myProject/myPackage/docs/20241127_myTask.docx" [2] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file1738842e35df5/MySponsor/myProject/myPackage/output/20241127_myTask/bin/20241127_myTask_task.json" [3] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file1738842e35df5/MySponsor/myProject/myPackage/output/20241127_myTask/bin/20241127_myTask_task.rds" [4] "D:/temp/2024_11_27_23_40_01_12290/RtmpQf49Ju/file1738842e35df5/MySponsor/myProject/myPackage/progs/20241127_myTask.Rmd" > > proc.time() user system elapsed 5.40 1.09 9.86