Returns the first or last parts of a vector.
Usage
head(x, n = 6L, ...)
tail(x, n = 6L, ...)
# S3 method for class 'spherical'
head(x, n = 6L, ...)
# S3 method for class 'spherical'
tail(x, n = 6L, ...)
Arguments
- x
objects of class
"Vec3"
,"Line"
,"Plane"
,"Pair"
, or"Fault
- n
an integer vector of length up to
dim(x)
(or 1, for non-dimensioned objects). Alogical
is silently coerced to integer. Values specify the indices to be selected in the corresponding dimension (or along the length) of the object. A positive value ofn[i]
includes the first/lastn[i]
indices in that dimension, while a negative value excludes the last/firstabs(n[i])
, including all remaining indices.NA
or non-specified values (whenlength(n) < length(dim(x))
) select all indices in that dimension. Must contain at least one non-missing value.- ...
arguments to be passed to or from other methods.
Examples
x <- rvmf(n = 10)
head(x)
#> Vector (Vec3) object (n = 6):
#> x y z
#> [1,] 0.9307843 -0.01296615 -0.3653388
#> [2,] 0.8989307 0.12067458 -0.4211428
#> [3,] 0.8467819 -0.21375259 0.4871039
#> [4,] 0.6564684 -0.12517527 0.7438954
#> [5,] 0.9804523 -0.01043877 -0.1964796
#> [6,] 0.8138278 -0.13245998 -0.5658079
tail(x)
#> Vector (Vec3) object (n = 6):
#> x y z
#> [1,] 0.9804523 -0.01043877 -0.1964796
#> [2,] 0.8138278 -0.13245998 -0.5658079
#> [3,] 0.8560463 0.31518244 0.4096885
#> [4,] 0.9137032 -0.10559061 0.3924247
#> [5,] 0.9016009 -0.17649539 0.3949244
#> [6,] 0.7732423 -0.34899708 0.5294312