R Under development (unstable) (2024-01-28 r85838 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("R.rsp") R.rsp v0.46.0 successfully loaded. See ?R.rsp for help. > library("R.utils") # Arguments Loading required package: R.oo Loading required package: R.methodsS3 R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help. R.oo v1.26.0 (2024-01-24 05:12:50 UTC) successfully loaded. See ?R.oo for help. Attaching package: 'R.oo' The following object is masked from 'package:R.methodsS3': throw The following objects are masked from 'package:methods': getClasses, getMethods The following objects are masked from 'package:base': attach, detach, load, save R.utils v2.12.3 (2023-11-18 01:00:02 UTC) successfully loaded. See ?R.utils for help. Attaching package: 'R.utils' The following object is masked from 'package:utils': timestamp The following objects are masked from 'package:base': cat, commandArgs, getOption, isOpen, nullfile, parse, use, warnings > > # A knitr Rnw file > path <- system.file("rsp_LoremIpsum", package="R.rsp") > pathname <- file.path(path, "LoremIpsum.txt.rsp") > print(pathname) [1] "D:/RCompile/CRANincoming/R-devel/lib/R.rsp/rsp_LoremIpsum/LoremIpsum.txt.rsp" > > outPath <- file.path("LoremIpsum", "txt.rsp") > pathnameR <- compileRsp(pathname, outPath=outPath, verbose=-10) Compiling RSP document... RSP pathname (absolute): D:/RCompile/CRANincoming/R-devel/lib/R.rsp/rsp_LoremIpsum/LoremIpsum.txt.rsp Input file size: 176 bytes Output and working directory: LoremIpsum/txt.rsp RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE Compiling RSP document...done > print(pathnameR) RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE > pathnameR <- Arguments$getReadablePathname(pathnameR) > > outPath <- file.path("LoremIpsum", "txt.rsp.rsp") > pathnameR2 <- compileRsp(pathname, outPath=outPath, verbose=-10) Compiling RSP document... RSP pathname (absolute): D:/RCompile/CRANincoming/R-devel/lib/R.rsp/rsp_LoremIpsum/LoremIpsum.txt.rsp Input file size: 176 bytes Output and working directory: LoremIpsum/txt.rsp.rsp RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE Compiling RSP document...done > print(pathnameR2) RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE > pathnameR2 <- Arguments$getReadablePathname(pathnameR2) > stopifnot(identical(readLines(pathnameR2), readLines(pathnameR))) > > outPath <- file.path("LoremIpsum", "txt.rsp.rsp,repeat") > pathnameR3 <- rfile(pathname, workdir=outPath, verbose=-10) Processing RSP file... Input pathname: D:/RCompile/CRANincoming/R-devel/lib/R.rsp/rsp_LoremIpsum/LoremIpsum.txt.rsp Output pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp,repeat/LoremIpsum.txt Default content type: text/plain Assigning RSP arguments... Environment: R_GlobalEnv Arguments assigned: Assigning RSP arguments...done Reading RSP document... Number of characters: 176 chr "Lorem Ipsum\n===========\n\nAuthor: R.rsp\n\nText\n----\n\n<%\nsentences <- c(\"<%@include file=\"includes/Lore"| __truncated__ Reading RSP document...done Parsing RSP document... RspDocument: Source: D:/RCompile/CRANincoming/R-devel/lib/R.rsp/rsp_LoremIpsum/LoremIpsum.txt.rsp Total number of RSP constructs: 7 Number of RspCode(s): 3 Number of RspCodeChunk(s): 1 Number of RspText(s): 3 Content type: text/plain Parsing RSP document...done Processing RSP document... Translating RSP document (to R)... Number of R source code lines: 68 Translating RSP document (to R)...done Processing RSP R source code... Output pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp,repeat/LoremIpsum.txt Assigning RSP arguments... Environment: R_GlobalEnv Arguments assigned: Assigning RSP arguments...done Evaluating RSP R source code... Temporary working directory: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp,repeat RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp,repeat/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE Evaluating RSP R source code...done Processing RSP R source code...done Processing RSP document...done Processing RSP file...done > print(pathnameR3) RspFileProduct: Pathname: d:/RCompile/CRANincoming/R-devel/R.rsp.Rcheck/tests/LoremIpsum/txt.rsp.rsp,repeat/LoremIpsum.txt File size: 510 bytes Content type: text/plain Has processor: FALSE > pathnameR3 <- Arguments$getReadablePathname(pathnameR3) > stopifnot(identical(readLines(pathnameR3), readLines(pathnameR))) > > proc.time() user system elapsed 1.01 0.20 3.59