Skip to contents

Returns the first or last parts of a vector.

Usage

# 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). A logical 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 of n[i] includes the first/last n[i] indices in that dimension, while a negative value excludes the last/first abs(n[i]), including all remaining indices. NA or non-specified values (when length(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.8226075  0.53060197  0.204397668
#> [2,] 0.8297550  0.45054829 -0.329412817
#> [3,] 0.6553978  0.65633603  0.373733541
#> [4,] 0.9265451  0.33978189 -0.161438835
#> [5,] 0.9969122 -0.07836393  0.005014657
#> [6,] 0.8577971  0.06298978  0.510114090
tail(x)
#> Vector (Vec3) object (n = 6):
#>              x           y            z
#> [1,] 0.9969122 -0.07836393  0.005014657
#> [2,] 0.8577971  0.06298978  0.510114090
#> [3,] 0.9606112 -0.18398767  0.208265752
#> [4,] 0.4934052 -0.02480132 -0.869445930
#> [5,] 0.5872673  0.01569155  0.809240910
#> [6,] 0.4810132  0.65593763 -0.581697627