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.9586761  0.10546346  0.2642301
#> [2,] 0.9219054 -0.32592537 -0.2094354
#> [3,] 0.4739840  0.87459031  0.1021319
#> [4,] 0.6218188  0.36080950  0.6950956
#> [5,] 0.9745349 -0.03640082  0.2212615
#> [6,] 0.9859367  0.02721217  0.1648888
tail(x)
#> Vector (Vec3) object (n = 6):
#>              x           y          z
#> [1,] 0.9745349 -0.03640082  0.2212615
#> [2,] 0.9859367  0.02721217  0.1648888
#> [3,] 0.7082288  0.60135288  0.3698468
#> [4,] 0.9879948  0.08696540 -0.1276841
#> [5,] 0.9283716 -0.34190980  0.1456843
#> [6,] 0.7941621 -0.33963800 -0.5039370