Movatterモバイル変換


[0]ホーム

URL:


rdrr.io

octmode: Display Numbers in Octal

octmodeR Documentation

Display Numbers in Octal

Description

Convert or print integers in octal format, with as many digits as areneeded to display the largest, using leading zeroes as necessary.

Usage

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, ...)

Arguments

x

An object, for the methods inheriting from class"octmode".

width

NULL or a positive integer specifying the minimumfield width to be used, with padding by leading zeroes.

...

further arguments passed to or from other methods.

Details

Class"octmode" consists of integer vectors with that classattribute, used merely to ensure that they are printed in octalnotation, specifically for Unix-like file permissions such as755. Subsetting ([) works too.

Ifwidth = NULL (the default), the output is padded withleading zeroes to the smallest width needed for all the non-missingelements.

as.octmode can convert integers (of type"integer" or"double") and character vectors whose elements contain onlydigits0-7 (or areNA) to class"octmode".

There is a! method and methods for| and&:these recycle their arguments to the length of the longer and thenapply the operators bitwise to each element.

See Also

These are auxiliary functions forfile.info.

hexmode,sprintf for other options inconverting integers to octal,strtoi to convert octalstrings to integers.

Examples

(on <- as.octmode(c(16, 32, 127:129))) # "020" "040" "177" "200" "201"unclass(on[3:4]) # subsetting## manipulate file modesfmode <- as.octmode("170")(fmode | "644") & "755"umask <- Sys.umask(NA) # depends on platformc(fmode, "666", "755") & !umask

What can we improve?

R Package Documentation

Browse R Packages

We want your feedback!

Note that we can't provide technical support on individual packages. You should contact the package authors for that.

 
Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, readEmbedding Snippets.

Close

[8]ページ先頭

©2009-2025 Movatter.jp