EVOLUTION-MANAGER
Edit File: octmode.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 Octal</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 octmode {base}"><tr><td>octmode {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Display Numbers in Octal</h2> <h3>Description</h3> <p>Convert or print integers in octal format, with as many digits as are needed to display the largest, using leading zeroes as necessary. </p> <h3>Usage</h3> <pre> as.octmode(x) ## S3 method for class 'octmode' as.character(x, ...) ## S3 method for class 'octmode' format(x, width = NULL, ...) ## S3 method for class 'octmode' 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>"octmode"</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>...</code></td> <td> <p>further arguments passed to or from other methods.</p> </td></tr> </table> <h3>Details</h3> <p>Class <code>"octmode"</code> consists of integer vectors with that class attribute, used merely to ensure that they are printed in octal notation, specifically for Unix-like file permissions such as <code>755</code>. Subsetting (<code><a href="Extract.html">[</a></code>) works too. </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.octmode</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 digits <code>0-7</code> (or are <code>NA</code>) to class <code>"octmode"</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>These are auxiliary functions for <code><a href="file.info.html">file.info</a></code>. </p> <p><code><a href="hexmode.html">hexmode</a></code>, <code><a href="sprintf.html">sprintf</a></code> for other options in converting integers to octal, <code><a href="strtoi.html">strtoi</a></code> to convert octal strings to integers. </p> <h3>Examples</h3> <pre> (on <- as.octmode(c(16, 32, 127:129))) # "020" "040" "177" "200" "201" unclass(on[3:4]) # subsetting ## manipulate file modes fmode <- as.octmode("170") (fmode | "644") & "755" umask <- Sys.umask(NA) # depends on platform c(fmode, "666", "755") & !umask </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>