EVOLUTION-MANAGER
Edit File: noquote.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Class for 'no quote' Printing of Character Strings</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for noquote {base}"><tr><td>noquote {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Class for ‘no quote’ Printing of Character Strings</h2> <h3>Description</h3> <p>Print character strings without quotes. </p> <h3>Usage</h3> <pre> noquote(obj, right = FALSE) ## S3 method for class 'noquote' print(x, quote = FALSE, right = FALSE, ...) ## S3 method for class 'noquote' c(..., recursive = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>obj</code></td> <td> <p>any <span style="font-family: Courier New, Courier; color: #666666;"><b>R</b></span> object, typically a vector of <code><a href="character.html">character</a></code> strings.</p> </td></tr> <tr valign="top"><td><code>right</code></td> <td> <p>optional <code><a href="logical.html">logical</a></code> eventually to be passed to <code>print()</code>, used by <code><a href="print.default.html">print.default</a>()</code>, indicating whether or not strings should be right aligned.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>an object of class <code>"noquote"</code>.</p> </td></tr> <tr valign="top"><td><code>quote, ...</code></td> <td> <p>further options passed to next methods, such as <code><a href="print.html">print</a></code>.</p> </td></tr> <tr valign="top"><td><code>recursive</code></td> <td> <p>for compatibility with the generic <code><a href="c.html">c</a></code> function.</p> </td></tr> </table> <h3>Details</h3> <p><code>noquote</code> returns its argument as an object of class <code>"noquote"</code>. There is a method for <code>c()</code> and subscript method (<code>"[.noquote"</code>) which ensures that the class is not lost by subsetting. The print method (<code>print.noquote</code>) prints character strings <em>without</em> quotes (<code>"\dots"</code>). </p> <p>If <code>right</code> is specified in a call <code>print(x, right=*)</code>, it takes precedence over a possible <code>right</code> setting of <code>x</code>, e.g., created by <code>x <- noquote(*, right=TRUE)</code>. </p> <p>These functions exist both as utilities and as an example of using (S3) <code><a href="class.html">class</a></code> and object orientation. </p> <h3>Author(s)</h3> <p>Martin Maechler <a href="mailto:maechler@stat.math.ethz.ch">maechler@stat.math.ethz.ch</a></p> <h3>See Also</h3> <p><code><a href="../../utils/html/methods.html">methods</a></code>, <code><a href="class.html">class</a></code>, <code><a href="print.html">print</a></code>. </p> <h3>Examples</h3> <pre> 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(stats::runif(20) > 0.8) chmat <- as.matrix(format(stackloss)) # a "typical" character matrix ## noquote(*, right=TRUE) so it prints exactly like a data frame chmat <- noquote(chmat, right = TRUE) chmat </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>