Description Arguments Details Examples
Extract or replace subsets of three-velocities
x |
A three-vector |
index |
elements to extract or replace |
value |
replacement value |
These methods (should) work as expected: an object of class
3vel
is a three-column matrix with rows corresponding to
three-velocities; a single argument is interpreted as a row number.
Salient use-cases are u[1:5] <- u[1]
and u[1] <- 0
.
To extract a single component, pass a second index: u[,1]
returns the x- component of the three-velocity.
Extraction functions take a drop
argument, except for x[i]
which returns a vec
object.
Currently, u[]
returns u
but I am not sure this is
desirable. Maybe it should return unclass(u)
or perhaps
c(unclass(u))
.
Use idiom u[] <- x
to replace entries of u
elementwise.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.