08.04.2015 Views

The sfsmisc Package - NexTag Supports Open Source Initiatives

The sfsmisc Package - NexTag Supports Open Source Initiatives

The sfsmisc Package - NexTag Supports Open Source Initiatives

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

22 digitsBase<br />

Usage<br />

diagX(n)<br />

Arguments<br />

n<br />

positive integer.<br />

Value<br />

a numeric n × n matrix with many zeros – apart from 1s in the other diagonal.<br />

Author(s)<br />

Martin Maechler, 1992.<br />

See Also<br />

diag.<br />

Examples<br />

diagX(4)<br />

for(m in 1:5)<br />

stopifnot(identical(diagX(m), diag(m)[, m:1, drop = FALSE]))<br />

digitsBase<br />

Digit/Bit Representation of Integers in any Base<br />

Description<br />

Integer number representations in other Bases.<br />

Formally, for every element N =x[i], compute the (vector of) “digits” A of the base b representation<br />

of the number N, N = ∑ M<br />

k=0 A M−kb k .<br />

Revert such a representation to integers.<br />

Usage<br />

digitsBase(x, base = 2, ndigits = 1 + floor(log(max(x), base)))<br />

## S3 method for class 'basedInt':<br />

as.integer(x, ...)<br />

## S3 method for class 'basedInt':<br />

print(x, ...)<br />

as.intBase(x, base = 2)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!