EVOLUTION-MANAGER
Edit File: hexmode.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: Display Numbers in Hexadecimal</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 hexmode {base}"><tr><td>hexmode {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Display Numbers in Hexadecimal</h2> <h3>Description</h3> <p>Convert or print integers in hexadecimal format, with as many digits as are needed to display the largest, using leading zeroes as necessary. </p> <h3>Usage</h3> <pre> as.hexmode(x) ## S3 method for class 'hexmode' as.character(x, ...) ## S3 method for class 'hexmode' format(x, width = NULL, upper.case = FALSE, ...) ## S3 method for class 'hexmode' print(x, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>An object, for the methods inheriting from class <code>"hexmode"</code>.</p> </td></tr> <tr valign="top"><td><code>width</code></td> <td> <p><code>NULL</code> or a positive integer specifying the minimum field width to be used, with padding by leading zeroes.</p> </td></tr> <tr valign="top"><td><code>upper.case</code></td> <td> <p>a logical indicating whether to use upper-case letters or lower-case letters (default).</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p>Class <code>"hexmode"</code> consists of integer vectors with that class attribute, used merely to ensure that they are printed in hex. </p> <p>If <code>width = NULL</code> (the default), the output is padded with leading zeroes to the smallest width needed for all the non-missing elements. </p> <p><code>as.hexmode</code> can convert integers (of <a href="typeof.html">type</a> <code>"integer"</code> or <code>"double"</code>) and character vectors whose elements contain only <code>0-9</code>, <code>a-f</code>, <code>A-F</code> (or are <code>NA</code>) to class <code>"hexmode"</code>. </p> <p>There is a <code><a href="Logic.html">!</a></code> method and methods for <code><a href="Logic.html">|</a></code> and <code><a href="Logic.html">&</a></code>: these recycle their arguments to the length of the longer and then apply the operators bitwise to each element. </p> <h3>See Also</h3> <p><code><a href="octmode.html">octmode</a></code>, <code><a href="sprintf.html">sprintf</a></code> for other options in converting integers to hex, <code><a href="strtoi.html">strtoi</a></code> to convert hex strings to integers. </p> <h3>Examples</h3> <pre> i <- as.hexmode("7fffffff") i; class(i) identical(as.integer(i), .Machine$integer.max) hm <- as.hexmode(c(NA, 1)); hm as.integer(hm) </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>