4_most_methods: Most Methods

Description Usage Arguments Details Value Examples

Description

Dim, print, format, head and tail methods for vector-like objects.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## S3 method for class 'ObjectArray'
dim(x)
## S3 method for class 'NestMatrix'
dim(x)
## S3 method for class 'SectMatrix'
dim(x)

## S3 method for class 'VectorLike'
print(x, ...)

## S3 method for class 'ObjectArray'
format(x, na.string="", ...)
## S3 method for class 'NestMatrix'
format(x, na.string="", ...)
## S3 method for class 'SectMatrix'
format(x, na.string="", ...)

## S3 method for class 'SectMatrix'
as.matrix(x, ...)

## S3 method for class 'VectorLike'
head(x, n=6, ...)
## S3 method for class 'VectorLike'
tail(x, n=6, ...)

Arguments

x

A VectorLike object.

na.string

What to format NAs as.

n

Number of items.

...

Other arguments.

Details

Refer to vignette for more information.

Note that the dimensions of object arrays and nested matrices are the dimensions of the top level (or collapsed) object. However, the dimensions of sectioned matrices (including partitioned matrices) are the dimensions or the combined (or expanded) matrix.

Note that the format method for ObjectArray, calls the objtag function, for each of its elements.

Value

The format, head and tail functions return formatted character matrices.

Examples

1
2
3
4
5
6
s = matrix (1:100, 10, 10)
x = as.PartMatrix (s, 5, c (2, 4, 6, 8) )

dim (x)
as.matrix (x)
head (x, 2)

vectools documentation built on Jan. 9, 2020, 5:09 p.m.