Type: | Package |
Title: | GDP - Workflow Management |
Version: | 2.1.18 |
Date: | 2025-03-28 |
Author: | Gregoire Thomas |
Maintainer: | Gregoire Thomas <gregoire.thomas@SQU4RE.com> |
Description: | Tools, methods and processes for the management of analysis workflows. These lightweight solutions facilitate structuring R&D activities. These solutions were developed to comply with Good Documentation Practice (GDP), with ALCOA+ principles as proposed by the U.S. FDA, and with FAIR principles as discussed by Jacobsen et al. (2017) <doi:10.1162/dint_r_00024>. |
Depends: | R (≥ 4.0.0), jsonlite, openssl |
Imports: | officedown, utils, rmarkdown, Biobase, openxlsx,reticulate,feather, getPass |
Suggests: | knitr, roxygen2 (≥ 3.1.0), WriteXLS,XLConnect,xlsx, testthat |
License: | GPL-3 |
Encoding: | UTF-8 |
Config/testthat/edition: | 3 |
RoxygenNote: | 7.3.2 |
VignetteBuilder: | knitr |
URL: | https://bitbucket.org/SQ4/d4talink.light |
ByteCompile: | true |
Repository: | CRAN |
BugReports: | https://bitbucket.org/SQ4/d4talink.light/issues |
NeedsCompilation: | no |
Packaged: | 2025-03-28 17:12:28 UTC; GregoireThomas |
Date/Publication: | 2025-04-02 15:50:10 UTC |
Arguments used across the functions of the D4TAlink package.
Description
Arguments used across the functions of the D4TAlink package.
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
author |
Author name, system username by default. |
sponsor |
Sponsor name, default set by |
rootpath |
Path of the task repository, default set by |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
dirType |
Directory type, e.g. 'bin' or 'data' or 'doc'. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
pathgen |
optional function returning a list of paths, currently |
Value
No return value, used for the documentation of the functions of the package.
D4TAlinkTask
Documentation of the D4TAlinkTask class
Description
The D4TAlinkTask
object is created by the initTask
function.
This object is a list containing the task properties:
- task:
task name
- package:
package name
- project:
project name
- sponsor:
sponsor name
- author:
author name
- copyright:
copyright, by default 'Copyright (c) [sponsor] [year]'
- 'date':
date of the task initialization, formatted as 'year-month-day'
- 'footer':
footer for the task, e.g., 'Copyright (c) [sponsor] [year] - CONFIDENTIAL'
- 'version':
string with task version, '0.0' at the initialization
- dependencies:
information on R versions and names of loaded/attached dependencies and corresponding versions
There are different functions dedicated for this D4TAlinkTask
object:
taskID
:Get ID
Value
Not relevant
Examples
## Not run:
# set D4TAlink's global parameters
setTaskAuthor("Doe Johns")
setTaskSponsor("mySponsor")
# Create data repository
setTaskRoot(file.path(tempdir(),"D4TAlink_example001"),dirCreate=TRUE)
# Create a task
task <- initTask(project="myProject",
package="myPackage",
taskname=sprintf("%s_myTask",format(Sys.time(),"%Y%m%d")))
# Output a plot to a PDF file
file <- pdfReport(task,c("plots",1),dim=c(100,100))
opa <- par()$ask
par(ask=FALSE)
hist(rnorm(100))
par(ask=opa)
dev.off()
# View the plot:
utils::browseURL(file)
# Output tables to an Excel file
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")
utils::browseURL(file)
# Save an R object to a binary file
saveBinary(d,task,"data")
e <- readBinary(task,"data")
if(!all(names(e)%in%names(d))) stop("error [1]")
# Create and render R markdown file
initTaskRmd(task,overwrite=TRUE)
file <- renderTaskRmd(task) # requires having run 'tinytex::install_tinytex()'
utils::browseURL(file)
# Delete new data repository
unlink(getTaskRoot(),recursive=TRUE)
## End(Not run)
Get env var.
Description
Get env var.
Usage
D4getenv(name, desc, quiet = FALSE)
Arguments
name |
name of variable |
desc |
description of variable |
quiet |
suppress error messages, default=FALSE. |
Value
Environment variable.
Generic function.
Description
Generic function.
Usage
DTx(sponsor = getTaskSponsor(), task = NULL)
Arguments
sponsor |
Sponsor name, default set by |
task |
Object of class |
Value
NULL
.
Create an archive containing the files of a given task.
Description
Create an archive containing the files of a given task.
Usage
archiveTask(task, file, overwrite = FALSE, ...)
Arguments
task |
Object of class |
file |
full name of the output zip file |
overwrite |
overwrite the output zip file is it exists |
... |
Arguments passed on to
|
Value
the archive file name invisibly.
Get path of binary directory.
Description
Get path of binary directory.
Usage
binaryDir(task, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of binary file.
Description
Get path of binary file.
Usage
binaryFn(task, type, ext = "rds", subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Output R object using function cat.
Description
Output R object using function cat.
Usage
catReport(
x,
task,
type,
ext = "txt",
subdir = NULL,
dirCreate = TRUE,
sep = "\n",
eof = "\n",
...
)
Arguments
x |
R object to output. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
sep |
separator |
eof |
EOF |
... |
R objects (see ‘Details’ for the types of objects allowed). |
Value
the file name invisibly.
Create a task.
Description
Create a task.
Usage
createTask(
project,
package,
taskname,
sponsor = getTaskSponsor(),
author = getTaskAuthor()
)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
author |
Author name, system username by default. |
Value
An D4TAlinkTask
object
Get path of data source directory.
Description
Get path of data source directory.
Usage
datasourceDir(task, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of data source file.
Description
Get path of data source file.
Usage
datasourceFn(task, filename, subdir = ".", dirCreate = TRUE)
Arguments
task |
Object of class |
filename |
name of the input file. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of documentation directory.
Description
Get path of documentation directory.
Usage
docDir(task, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of documentation file.
Description
Get path of documentation file.
Usage
docFn(task, type, ext, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Replace default task fields in 'docx' file.
Description
Replace default task fields in 'docx' file.
Usage
formatTaskDocx(task, ifn)
Arguments
task |
Object of class |
ifn |
input file name. |
Value
the file name invisibly.
Get the name of the task author.
Description
Get the name of the task author.
Usage
getTaskAuthor(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
The current name of the tasks author.
Examples
getTaskAuthor(quiet=TRUE)
Get the encryption key for binary data files.
Description
Get the encryption key for binary data files.
Usage
getTaskEnckey(ask = FALSE)
Arguments
ask |
query encryption key from user, default FALSE. |
Value
The encryption key invisibly.
Get the path of a file.
Description
Get the path of a file.
Usage
getTaskFilepath(task, type, ext, dirtype, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
dirtype |
task directory where file is stored, i.e., 'documentation', 'code', 'data', 'data source' or 'binary data'. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
Full path to file.
Get the paths of the task.
Description
Get the paths of the task.
Usage
getTaskPaths(task)
Arguments
task |
Object of class |
Value
List of task's paths.
Get the path to the Rmd task template.
Description
Get the path to the Rmd task template.
Usage
getTaskRmdTemplate(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
The path to the Rmd task template.
Get the root of the task repository.
Description
Get the root of the task repository.
Usage
getTaskRoot(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
Path to the current task root.
Examples
getTaskRoot(quiet=TRUE)
Get the path to the R script task template.
Description
Get the path to the R script task template.
Usage
getTaskRscriptTemplate(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
The path to the R script task template.
Get the name of the task sponsor.
Description
Get the name of the task sponsor.
Usage
getTaskSponsor(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
The current name of the tasks sponsor.
Examples
getTaskSponsor(quiet=TRUE)
Get repository directory structure.
Description
Get repository directory structure.
Usage
getTaskStructure(quiet = FALSE)
Arguments
quiet |
suppress error messages, default=FALSE. |
Value
The directory structure function.
Initialize a task
Description
During the initialization:
The folder structure for the task is created in the data repository.
The task properties are also saved in rds and json format.
Please note that it is recommended to load packages for your analysis before initializing the task.
Usage
initTask(
project,
package,
taskname,
sponsor = getTaskSponsor(),
author = getTaskAuthor(),
dirCreate = TRUE,
templateCreate = FALSE,
overwrite = FALSE
)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
author |
Author name, system username by default. |
dirCreate |
logical, if TRUE (by default) the directory structure for the task is created in the repository. |
templateCreate |
create the prefilled Rmd template for the task, default value: FALSE. |
overwrite |
logical, if TRUE and the task already exists, overwrite its parameters. |
Value
D4TAlinkTask
object
Create task template in Rmd format.
Description
Create task template in Rmd format.
Usage
initTaskRmd(task, encoding = "unknown", overwrite = FALSE, suffix = NA)
Arguments
task |
Object of class |
encoding |
encoding to be assumed for input strings. It is
used to mark character strings as known to be in
Latin-1, UTF-8 or to be bytes: it is not used to re-encode the input.
To do the
latter, specify the encoding as part of the connection |
overwrite |
overwrite Rmd file if exists, default FALSE |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
Value
the file name invisibly.
Create task R script.
Description
Create task R script.
Usage
initTaskRscript(task, overwrite = FALSE, encoding = "unknown", suffix = NA)
Arguments
task |
Object of class |
overwrite |
overwrite R file if exists, default FALSE |
encoding |
encoding to be assumed for input strings. It is
used to mark character strings as known to be in
Latin-1, UTF-8 or to be bytes: it is not used to re-encode the input.
To do the
latter, specify the encoding as part of the connection |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
Value
the file name invisibly.
Graphics devices for JPEG
format bitmap files.
Description
Graphics devices for JPEG
format bitmap files.
Usage
jpegReport(
task,
type,
ext = "jpg",
subdir = NULL,
dirCreate = TRUE,
dim = c(500, 500),
width = NULL,
height = NULL,
...
)
Arguments
task |
Object of class |
type |
character string, one of |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
dim |
device height and width in |
width |
device height in |
height |
device height in |
... |
Arguments passed on to
|
Value
the file name invisibly.
Get path of jpeg
output file.
Description
Get path of jpeg
output file.
Usage
jpegReportFn(task, type, ext = "jpg", subdir = NULL)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
Value
File path.
List the files associated to a task.
Description
List the files associated to a task.
Usage
listTaskFiles(task, full.names = FALSE, which = NULL)
Arguments
task |
Object of class |
full.names |
a logical value. If |
which |
list of file types to list. |
Value
array of file names.
List details of all tasks stored in the root directory.
Description
List details of all tasks stored in the root directory.
Usage
listTasks(
project = NULL,
package = NULL,
sponsor = NULL,
rootpath = getTaskRoot()
)
Arguments
project |
Project name. |
package |
Package name. |
sponsor |
Sponsor name, default set by |
rootpath |
Path of the task repository, default set by |
Value
data.frame
with the following information for tasks "sponsor", "project", "package", "task".
Load a task.
Description
Load a task.
Usage
loadTask(
project,
package,
taskname,
sponsor = getTaskSponsor(),
author = getTaskAuthor(),
quiet = FALSE
)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
author |
Author name, system username by default. |
quiet |
issue warning if file does not exists. |
Value
Object of class D4TAlinkTask
or NULL if the task
does not exists.
Task paths generator.
Description
The paths are: datasrc: [ROOT]/[sponsor]/[project]/[package]/raw/datasource data: [ROOT]/[sponsor]/[project]/[package]/output/[taskname] bin: [ROOT]/[sponsor]/[project]/[package]/output/[taskname]/bin code: [ROOT]/[sponsor]/[project]/[package]/progs doc: [ROOT]/[sponsor]/[project]/[package]/docs log: [ROOT]/[sponsor]/[project]/[package]/output/log
Usage
pathsDefault(project, package, taskname, sponsor)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
Value
a list of file paths
Task paths generator.
Description
The paths are: datasrc: [ROOT]/[sponsor]/[project]/[package]/raw/datasource data: [ROOT]/[sponsor]/[project]/[package]/output/adhoc/[taskname] bin: [ROOT]/[sponsor]/[project]/[package]/output/adhoc/[taskname]/bin code: [ROOT]/[sponsor]/[project]/[package]/progs doc: [ROOT]/[sponsor]/[project]/[package]/docs log: [ROOT]/[sponsor]/[project]/[package]/output/log
Usage
pathsGLPG(project, package, taskname, sponsor)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
Value
a list of file paths
Task paths generator.
Description
The paths are: datasrc: [ROOT]/[sponsor]/PMS_data/[project]/[package]/datasource data: [ROOT]/[sponsor]/PMS_data/[project]/[package]/[taskname] bin: [ROOT]/[sponsor]/PMS_data/[project]/[package]/[taskname]/bin code: [ROOT]/[sponsor]/PMS_code/[project]/[package]/R doc: [ROOT]/[sponsor]/PMS_documentation/[project]/[package]/[taskname] log: [ROOT]/[sponsor]/PMS_data/[project]/[package]/[taskname]/log
Usage
pathsPMS(project, package, taskname, sponsor)
Arguments
project |
Project name. |
package |
Package name. |
taskname |
Task name. |
sponsor |
Sponsor name, default set by |
Value
a list of file paths
Graphics devices for pdf
format bitmap files.
Description
Graphics devices for pdf
format bitmap files.
Usage
pdfReport(
task,
type,
ext = "pdf",
subdir = NULL,
dirCreate = TRUE,
title = NA,
file = NA,
dim = c(297, 210),
height = NULL,
width = NULL,
landscape = NULL,
...
)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
title |
title string to embed as the ‘/Title’ field in the
file. Defaults to |
file |
a character string giving the file path.
If it is of the form For use with Tilde expansion (see |
dim |
device height and width in |
height |
device height in |
width |
device height in |
landscape |
if defined, orientation of the document. |
... |
Arguments passed on to
|
Value
the file name invisibly.
Get path of pdf
output file.
Description
Get path of pdf
output file.
Usage
pdfReportFn(task, type, ext = "pdf", subdir = NULL)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
Value
File path.
Graphics devices for PNG
format bitmap files.
Description
Graphics devices for PNG
format bitmap files.
Usage
pngReport(
task,
type,
ext = "png",
subdir = NULL,
dirCreate = TRUE,
dim = c(500, 500),
width = NULL,
height = NULL,
...
)
Arguments
task |
Object of class |
type |
character string, one of |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
dim |
device height and width in |
width |
device height in |
height |
device height in |
... |
Arguments passed on to
|
Value
the file name invisibly.
Get path of png
output file.
Description
Get path of png
output file.
Usage
pngReportFn(task, type, ext = "png", subdir = NULL)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
Value
File path.
Get path of scripts directory.
Description
Get path of scripts directory.
Usage
progDir(task, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Restore R object from binary file.
Description
Restore R object from binary file.
Usage
readBinary(
task,
type,
subdir = NULL,
dirCreate = FALSE,
ask = FALSE,
quiet = FALSE,
password = NULL
)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
ask |
query encryption key from user, default FALSE. |
quiet |
issue warning if file does not exists. |
password |
encryption password, default NULL |
Value
Object stored in binary file, or NULL
if file does not exist.
Restore R data.frame from Apache Arrow feather file.
Description
Restore R data.frame from Apache Arrow feather file.
Usage
readFeather(task, type, subdir = NULL, dirCreate = FALSE, quiet = FALSE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
quiet |
issue warning if file does not exists. |
Value
Object stored in Apache Arrow feather file, or NULL
if file does not exist.
Restore R data.frame from a Python pickle file.
Description
Restore R data.frame from a Python pickle file.
Usage
readPickle(task, type, subdir = NULL, dirCreate = FALSE, quiet = FALSE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
quiet |
issue warning if file does not exists. |
Value
Object stored in Apache Arrow feather file, or NULL
if file does not exist.
Read JSON data into R object.
Description
Read JSON data into R object.
Usage
readReportJSON(task, type, ext = "json", subdir = NULL, dirCreate = FALSE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
the data read, or NULL
if the file does not exist.
Read data into vector or list using function scan
.
Description
Read data into vector or list using function scan
.
Usage
readReportTable(task, type, ext = "csv", subdir = NULL, dirCreate = FALSE, ...)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
... |
Arguments passed on to
|
Value
the data read, or NULL
if the file does not exist.
Render the task from the Rmd file
Description
The template of the task is rendered towards pdf or html in the documentation directory of the specified task. Note that on windows, Gnu zip may be required. The path to the executable must be added to the environment variables.
Usage
renderTaskRmd(
task,
output_format = NULL,
debug = FALSE,
clean = TRUE,
suffix = NA,
...
)
Arguments
task |
Object of class |
output_format |
The R Markdown output format to convert to. The option
|
debug |
if TRUE execute in the global environment. |
clean |
Using |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
... |
Arguments passed on to
|
Value
the file name invisibly.
Get path of report directory.
Description
Get path of report directory.
Usage
reportDir(task, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of output file.
Description
Get path of output file.
Usage
reportFn(task, type, ext, subdir = NULL, dirCreate = TRUE)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
File path.
Get path of xlsx
output file.
Description
Get path of xlsx
output file.
Usage
reportXlsFn(task, type, ext = "xlsx", subdir = NULL)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
Value
File path.
Restore an archive containing the files of a given task from a file created with archiveTask.
Description
Restore an archive containing the files of a given task from a file created with archiveTask.
Usage
restoreTask(file, overwrite = FALSE, list = FALSE, code = TRUE, ...)
Arguments
file |
full name of the input zip file |
overwrite |
If |
list |
If |
code |
restore code, default TRUE |
... |
Arguments passed on to
|
Value
if list FALSE, the task imported incisibly, otherwise the list of files in the archive.
Get path of R script file name.
Description
Get path of R script file name.
Usage
rmdFn(task, suffix = NA)
Arguments
task |
Object of class |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
Value
File path.
Get path of R script file name.
Description
Get path of R script file name.
Usage
rscriptFn(task, suffix = NA)
Arguments
task |
Object of class |
suffix |
Filename suffix, used to develop scripts for sub-analyses for a given task, default NA. |
Value
File path.
Save R object in binary file.
Description
Save R object in binary file.
Usage
saveBinary(
object,
task,
type,
subdir = NULL,
dirCreate = TRUE,
encrypt = FALSE,
ask = FALSE
)
Arguments
object |
R object to serialize. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
encrypt |
encrypt the output, default: FALSE. If character string, then use the string as password. |
ask |
query encryption key from user, default FALSE. |
Value
the file name invisibly.
Save R object in encrypted binary file.
Description
Save R object in encrypted binary file.
Usage
saveBinaryE(object, task, type, subdir = NULL, dirCreate = TRUE, ask = FALSE)
Arguments
object |
R object to serialize. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
ask |
query encryption key from user, default FALSE. |
Value
the file name invisibly.
Save R object in Apache Arrow feather file.
Description
Save R object in Apache Arrow feather file.
Usage
saveFeather(object, task, type, subdir = NULL, dirCreate = TRUE)
Arguments
object |
data.frame to serialize. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
the file name invisibly.
Save R object in Python pickle file.
Description
Save R object in Python pickle file.
Usage
savePickle(object, task, type, subdir = NULL, dirCreate = TRUE)
Arguments
object |
data.frame to serialize. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
the file name invisibly.
Output R object in JSON format.
Description
Output R object in JSON format.
Usage
saveReportJSON(x, task, type, ext = "json", subdir = NULL, dirCreate = TRUE)
Arguments
x |
R object to output. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
the file name invisibly.
Output R object using function write.csv
.
Description
Output R object using function write.csv
.
Usage
saveReportTable(
x,
task,
type,
ext = "csv",
subdir = NULL,
dirCreate = TRUE,
gzip = FALSE,
...
)
Arguments
x |
R object to output. |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
gzip |
unused. |
... |
Arguments passed on to
|
Value
the file name invisibly.
Save R object in binary file.
Description
Save R object in binary file.
Usage
saveReportXls(
x,
task,
type,
ext = "xlsx",
subdir = NULL,
dirCreate = TRUE,
AdjWidth = TRUE,
FreezeRow = 1,
FreezeCol = 3,
metadata = "metadata",
metadata.append = NULL,
...
)
Arguments
x |
object to save. It can be either a data frame, an object of type |
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
AdjWidth |
If |
FreezeRow |
Rows including this row and above this row will be
frozen and not scroll. The default value of |
FreezeCol |
Columns including this column and to the left of this
column will be frozen and not scroll. The default value of
|
metadata |
prefix for names of worksheets holding metadata. |
metadata.append |
array of metadata field names to be appended in header of tables. |
... |
Arguments passed on to
|
Value
the file name invisibly.
Read data into vector or list using function scan
.
Description
Read data into vector or list using function scan
.
Usage
scanReport(
task,
type,
ext = "txt",
subdir = NULL,
dirCreate = TRUE,
what = "",
...
)
Arguments
task |
Object of class |
type |
Filename type. If the type is an array, the cocatenation of the elements is used with separator"-". Filenames have the form [task name]_[type].[ext] |
ext |
Filename extension. |
subdir |
(optional) Subdirectory. |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
what |
the type of |
... |
Arguments passed on to
|
Value
the data read, or NULL
if the file does not exist.
Set the name of the tasks author.
Description
Set the name of the tasks author.
Usage
setTaskAuthor(author)
Arguments
author |
Author name, system username by default. |
Value
The current name of the tasks author.
Examples
setTaskAuthor("Doe Johns")
Set the encryption key for binary data files.
Description
Set the encryption key for binary data files.
Usage
setTaskEnckey(key)
Arguments
key |
encryption key, if NULL then query key from user. |
Value
NULL
invisibly.
Set the path to the Rmd task template.
Description
Set the path to the Rmd task template.
Usage
setTaskRmdTemplate(file, encoding = "unknown")
Arguments
file |
path to the Rmd task template. |
encoding |
encoding to be assumed for input strings. It is
used to mark character strings as known to be in
Latin-1, UTF-8 or to be bytes: it is not used to re-encode the input.
To do the
latter, specify the encoding as part of the connection |
Value
The path to the Rmd task template invisibly.
Set the root of the task repository.
Description
Set the root of the task repository.
Usage
setTaskRoot(rootpath, dirCreate = FALSE)
Arguments
rootpath |
Path of the task repository, default set by |
dirCreate |
Logical, if TRUE (by default) the directory is created. |
Value
Path to the current task root.
Set the path to the R script task template.
Description
Set the path to the R script task template.
Usage
setTaskRscriptTemplate(file)
Arguments
file |
path to the Rmd task template. |
Value
The path to the Rmd task template invisibly.
Set the name of the tasks sponsor.
Description
Set the name of the tasks sponsor.
Usage
setTaskSponsor(sponsor)
Arguments
sponsor |
Sponsor name, default set by |
Value
The current name of the tasks sponsor.
Examples
setTaskSponsor("SQU4RE")
Set task repository directory structure.
Description
Set task repository directory structure.
Usage
setTaskStructure(pathgen)
Arguments
pathgen |
optional function returning a list of paths, currently |
Value
The task directory structure function invisibly.
Examples
fun <- function(project,package,taskname,sponsor) {
basePath <- file.path("%ROOT%",sponsor,project,package)
list(
root = "%ROOT%",
datasrc = file.path(basePath, "raw", "data_source"),
data = file.path(basePath, "output","adhoc",taskname),
bin = file.path(basePath, "output","adhoc",taskname,"bin"),
code = file.path(basePath, "progs"),
doc = file.path(basePath, "docs"),
log = file.path(basePath, "output","log")
)
}
setTaskStructure(fun)
Get task identifier string.
Description
Get task identifier string.
Usage
taskID(task, sep = "/")
Arguments
task |
Object of class |
sep |
the field separator character, default: "/". |
Value
String with task ID as:[sponsor][sep][project][sep][package][sep][task]