# NOT RUN {
##
## 1. typical use
##
tstVec <- c('Now', 'is', 'the', 'time')
msg <- createMessage(tstVec, 9, collapse=':',
endchars='//')
# }
# NOT RUN {
all.equal(msg, 'Now:is://')
# }
# NOT RUN {
##
## 2. in a function
##
tstFn <- function(cl)createMessage(deparse(cl), 9)
Cl <- quote(plot(1:3, y=4:6, col='red', main='Title'))
msg0 <- tstFn(Cl)
# check
msg. <- 'plot(1...'
# }
# NOT RUN {
all.equal(msg0, msg.)
# }
# NOT RUN {
##
## 3. default
##
y <- createMessage(character(3), default='y')
# }
# NOT RUN {
all.equal(y, 'y')
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab