Example 3.13: components of the ratmat object we created earlier had common time points, making it an ideal candidate to be converted into a balanced object:Incidentally, as.balanced is also useful with ordinary matrices; if X is a matrix then as.balanced(X) returns the same value as balanced(X).
![]()
Note that the common t component makes for a somewhat more compact printed representation.For demonstration purposes, let's make the first time series in ratmat of a different length, and see what happens then.
![]()
The other two time series have been ``padded out'' with NA's to fit in the data matrix.
An analogous function as.ldamat also exists to convert balanced objects into ldamat objects, although this is a rather less common procedure.