Description Usage Arguments Details Value Note Examples
Create a matrix of unevenly spaced time series ("uts_matrix"
).
is.uts_matrix
returns TRUE
if its argument is a "uts_matrix"
object.
1 2 3 | uts_matrix(data = uts(), nrow = 1, ncol = 1, byrow = FALSE, dimnames = NULL)
is.uts_matrix(x)
|
data |
a |
nrow |
the desired number of rows. |
ncol |
the desired number of columns. |
byrow |
logical. If |
dimnames |
a |
x |
an R object. |
If there are too few elements in data to fill the matrix, then the elements in data are recycled. However, compared to matrix
in base R, this function makes fewer guesses about how to coerce and recycle the data, and instead throws an error.
Class "uts_matrix"
inherits from class "uts_vector"
. Hence, a "uts_matrix"
supports all of the methods of a "uts_vector"
, such as first
, last
, start
, end
, etc., even though no such methods exist specifically for a "uts_matrix"
.
An object of class "uts_matrix"
.
An abstract class "uts_virtual"
exists from which "uts"
, "uts_vector"
, and "uts_matrix"
inherit: it is used to allow operations such as subtraction to mix the classes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Create using a single "uts" with recycling
uts_matrix(ex_uts(), 2, 3)
# Create using "uts_vector" with recycling
uts_matrix(ex_uts_vector(), 2, 3)
uts_matrix(ex_uts_vector(), 2, 2, byrow=TRUE)
uts_matrix(ex_uts_vector(), ncol=2)
# Empty "uts_matrix"
uts_matrix(nrow=2, ncol=3, dimnames=list(c("a", "b"), c("X", "Y", "Z")))
# One of the dimensions is of length zero
uts_matrix(nrow=0, ncol=4)
uts_matrix(nrow=4, ncol=0)
uts_matrix(nrow=0)
# The first test returns TRUE, the others return FALSE
is.uts_matrix(uts_matrix())
is.uts_matrix(uts_vector())
is.uts_matrix(ex_uts())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.