dot-format: Format objects for error logging

.formatR Documentation

Format objects for error logging

Description

Format objects for error logging

Usage

.formatQuote(v)

.formatComma(v)

.formatParams(v, con = "and")

.formatData(v)

.formatLog(v, fname = c())

.formatO(v, fname)

Arguments

v

character vector; just some strings

fname

character; function name

.log

character; previous called functions

Value

character

Functions

  • .formatQuote: add quotes to the vector elements: "<v[i]>"

  • .formatComma: add commas between the vector elements: <v[1]>, <v[2]>, <v[3]>

  • .formatParams: format the vector: "<v[1]>", "<v[2]>" and "<v[3]>"

  • .formatData: format the vector: <v[1]>$<v[2]>$<v[3]>

  • .formatLog: format the vector: "<v[1]>", "<v[2]>" and "<v[3]>" (in <fname>)

  • .formatO: format a object name with its calling function

Note

Internal function only for convenience

Examples

## Not run: 
v <- c("one", "two", "three")
fname <- "foo"
.log <- c("foo1", "foo2", "foo3")

.formatQuote(v)
#[1] "\"one\""   "\"two\""   "\"three\""

.formatComma(v)
#[1] "one, two, three"

.formatParams(v)
#[1] "\"one\", \"two\" and \"three\""

.formatData(v)
#[1] "one$two$three"

.formatLog(v)
#[1] "\"one\", \"two\" and \"three\""

.formatLog(v, fname)
#[1] "\"one\", \"two\" and \"three\" (in foo)"

.formatO(.formatLog(v), fname)
#[1] "\"\"one\", \"two\" and \"three\"\" (foo)"

## End(Not run)

frankkramer-lab/RCX documentation built on Feb. 4, 2023, 5:12 p.m.