Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 如何使用as.hexmode宽度_R_Hex - Fatal编程技术网

R 如何使用as.hexmode宽度

R 如何使用as.hexmode宽度,r,hex,R,Hex,根据R文件: 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, ...) 论据 x对象,用于从类“hexmode”继承的方法 宽度NULL或指定最小字段宽度的

根据R文件:

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

x对象,用于从类“hexmode”继承的方法

宽度NULL或指定最小字段宽度的正整数 要使用,用前导零填充

如果我调用R 3.02:

> hex <- "5"
> as.hexmode(hex,width=2)

如何正确调用as.hexmode?

宽度参数属于
格式
(嗯,
格式.hexmode
),而不是
作为.hexmode

format(as.hexmode(hex), width=2)
format(as.hexmode(hex), width=2)