| noquote {base} | R Documentation |
Print character strings without quotes.
noquote(obj) ## S3 method for class 'noquote': print(x, ...)
obj |
any R object, typically a vector of
character strings. |
x |
an object of class "noquote". |
... |
further options for print. |
noquote returns its argument as an object of class
"noquote". There is a subscript method ("[.noquote")
which ensures that the class is not lost by subsetting. The print
method (print.noquote) prints character stringss without
quotes ("...").
These functions exist both as utilities and as an example of using
class and object orientation.
Martin Maechler maechler@stat.math.ethz.ch
letters
nql <- noquote(letters)
nql
nql[1:4] <- "oh"
nql[1:12]
cmp.logical <- function(log.v)
{
## Purpose: compact printing of logicals
log.v <- as.logical(log.v)
noquote(if(length(log.v)==0)"()" else c(".","|")[1+log.v])
}
cmp.logical(runif(20) > 0.8)