R6ClassDocuStatus: R6 Class Representing Document Status Objects

Description Usage Format Value Fields Methods Examples

Description

R6ClassDocuStatus objects can be used to represent the status of a given document. A core requirement is that the different status records should be persistent across different compilation runs. That makes it necessary to store the intermediate states of an R6ClassDocuStatus object in a file. Given that requirement we must have methods for reading status information from a file and for writing status information to a file. Furthermore, we need a method to add a document status record and we must be able to display all document status records as a table.

Usage

1

Format

R6Class object.

Value

Object of R6Class with methods for managing the status of a document.

Fields

version

current version of the document

author

author of the change leading to the current status of the document

date

date of the current change

status

description of document status

project

project this document belongs to

status_colnames

vector of column names shown in the document table

status_history

dataframe with the document history read from the history file

history_file

name of the file containing the document history

Methods

new()

This method instantiates an object of class R6ClassDocuStatus

initialize()

Initialization of field called after creating the instance

writeStatusToFile(psFileName = NULL)

Writes current status and history to a tab-separated file. Tab-separated format is chosen, because TAB-characters are less likely to occur in any of the table fields. If argument psFileName is not null the name of the output file is set to psFileName, otherwise the value in field history_file is used. File encoding is set to "UTF-8" in order to preserve German Umlauts

readStatusFromFile(psFileName = NULL)

Document status history is read from the history file. The name of the history file is either taken from the method argument psFileName or from the object field history_file.

readCsv2StatusFromFile(psFileName = NULL)

Reading method for old csv2 formatted status history files. This is mainly used for converting history files from old csv2 format to new tab-separated format.

knitr_kable

Add current document status info to document history and convert it to a dataframe. Then use knitr::kable to convert the dataframe into a markdown-table

include_doc_stat(psTitle)

Saves updated document status to the status file. Write section header psTitle for document status and write markdown table containing the document status.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
r6objDocuStat <- R6ClassDocuStatus$new()
r6objDocuStat$setProject(psProject = "DEXSeq")
r6objDocuStat$setVersion(psVersion = "0.0.900")
r6objDocuStat$setDate(psDate = "31.03.2016")
r6objDocuStat$setAuthor(psAuthor = "pvr")
r6objDocuStat$setStatus(psStatus = "Init")
## Not run: 
r6objDocuStat$writeStatusToFile()
r6objDocuStat$knitr_kable()

## End(Not run)

pvrqualitasag/rqudocuhelper documentation built on May 26, 2019, 11:34 a.m.