if (FALSE) {
p <- tempdir()
f <- "rbdatpro.r"
tx <- c("require(rBDATPRO)", "library(rBDATPRO)",
"rBDATPRO::getDiameter(list(spp=1, D1=30, H=27))")
pf <- file.path(p, f)
writeLines(tx, con=pf)
file.exists(pf)
list.files(p)
# file.show(pf)
## define different output specs
outpath1 <- file.path(tempdir(), "devel/rbdatScript.r")
outpath2 <- p
outpath3 <- "rbdatScript.r"
(updated_file <- updateBdatNamespace(pf, outpath = NULL))
list.files(p)
# file.show(updated_file)
(updated_file <- updateBdatNamespace(pf, outpath1))
list.files(file.path(p, "devel"))
# file.show(updated_file)
(updated_file <- updateBdatNamespace(pf, outpath2))
list.files(p)
# file.show(updated_file)
(updated_file <- updateBdatNamespace(pf, outpath3))
list.files(p)
# file.show(updated_file)
}
Run the code above in your browser using DataLab