Description Usage Arguments Value Author(s) See Also Examples
The data type longitudinal
stores multiple time series data. It allows repeated
measurements, irregular sampling, and unequal temporal spacing of the time points.
as.longitudinal
converts a matrix into a longitudinal
object. The columns of the
input matrix are considered as individual variables (time series). The rows contain the
measurements in temporal order (for instance, rows 1-10 could contain 10 repeated measurements taken at
time point 1, rows 11-20 further 10 measurements taken at time point 2, and so on).
The dates for the time points can be specified with the argument times
and need not
be equally spaced. With the argument repeats
it is possible to specify the number
of measurements per time point (this may be different from time point to time point). In the resulting
longitudinal
matrix object the row names will indicate both the time points and the
repetition number (e.g., "10-1", "10-2", "10-3", ..., "20-1", "20-2", "20-3", etc.).
is.longitudinal
checks whether a matrix has the longitudinal
attributes.
The functions summary
, print
, plot
are the standard generic functions
adapted to longitudinal
objects.
1 2 3 4 5 6 7 8 |
x, object |
Time series data, contained in a |
repeats |
Integer, or a vector of integers, that specifies the number of available measurements per time point. If only one number is given then it is assumed the time series is regularly sampled. If instead a vector is specified, then each time point may have a different number of samples. |
time |
A vector with the dates for the time points. If not specified, equally spaced time points 1, 2, 3, ... are assumed. |
series |
Number, or a vector of numbers, that indicates which time series (=variables and columns of x) are plotted. |
type |
Determines whether the plotted line corresponds to the mean or median value of the samples per time point (default: "median"). |
autolayout |
determine the number of columns and rows in the plot automatically in the display of multiple time series (default: TRUE). |
... |
Additional optional parameters |
as.longitudinal
returns a longitudinal
object.
is.longitudinal
returns TRUE or false.
Korbinian Strimmer (https://strimmerlab.github.io).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # load "longitudinal" library
library("longitudinal")
# load data set
data(tcell)
is.longitudinal(tcell.34)
attributes(tcell.34)
tcell.34[,1:3]
# how many samples and how many genes?
dim(tcell.34)
summary(tcell.34)
# plot first nine time series
plot(tcell.34, 1:9)
#####
# an artificial example with repeated measurements, irregular sampling, and unequal spacing
m <- matrix(rnorm(200), 50, 4)
z <- as.longitudinal(m, repeats=c(10,5,5,10,20), time=c(2,8,9,15,16))
plot(z, 1:4)
|
Loading required package: corpcor
[1] TRUE
$dim
[1] 340 58
$dimnames
$dimnames[[1]]
[1] "0-1" "0-2" "0-3" "0-4" "0-5" "0-6" "0-7" "0-8" "0-9"
[10] "0-10" "0-11" "0-12" "0-13" "0-14" "0-15" "0-16" "0-17" "0-18"
[19] "0-19" "0-20" "0-21" "0-22" "0-23" "0-24" "0-25" "0-26" "0-27"
[28] "0-28" "0-29" "0-30" "0-31" "0-32" "0-33" "0-34" "2-1" "2-2"
[37] "2-3" "2-4" "2-5" "2-6" "2-7" "2-8" "2-9" "2-10" "2-11"
[46] "2-12" "2-13" "2-14" "2-15" "2-16" "2-17" "2-18" "2-19" "2-20"
[55] "2-21" "2-22" "2-23" "2-24" "2-25" "2-26" "2-27" "2-28" "2-29"
[64] "2-30" "2-31" "2-32" "2-33" "2-34" "4-1" "4-2" "4-3" "4-4"
[73] "4-5" "4-6" "4-7" "4-8" "4-9" "4-10" "4-11" "4-12" "4-13"
[82] "4-14" "4-15" "4-16" "4-17" "4-18" "4-19" "4-20" "4-21" "4-22"
[91] "4-23" "4-24" "4-25" "4-26" "4-27" "4-28" "4-29" "4-30" "4-31"
[100] "4-32" "4-33" "4-34" "6-1" "6-2" "6-3" "6-4" "6-5" "6-6"
[109] "6-7" "6-8" "6-9" "6-10" "6-11" "6-12" "6-13" "6-14" "6-15"
[118] "6-16" "6-17" "6-18" "6-19" "6-20" "6-21" "6-22" "6-23" "6-24"
[127] "6-25" "6-26" "6-27" "6-28" "6-29" "6-30" "6-31" "6-32" "6-33"
[136] "6-34" "8-1" "8-2" "8-3" "8-4" "8-5" "8-6" "8-7" "8-8"
[145] "8-9" "8-10" "8-11" "8-12" "8-13" "8-14" "8-15" "8-16" "8-17"
[154] "8-18" "8-19" "8-20" "8-21" "8-22" "8-23" "8-24" "8-25" "8-26"
[163] "8-27" "8-28" "8-29" "8-30" "8-31" "8-32" "8-33" "8-34" "18-1"
[172] "18-2" "18-3" "18-4" "18-5" "18-6" "18-7" "18-8" "18-9" "18-10"
[181] "18-11" "18-12" "18-13" "18-14" "18-15" "18-16" "18-17" "18-18" "18-19"
[190] "18-20" "18-21" "18-22" "18-23" "18-24" "18-25" "18-26" "18-27" "18-28"
[199] "18-29" "18-30" "18-31" "18-32" "18-33" "18-34" "24-1" "24-2" "24-3"
[208] "24-4" "24-5" "24-6" "24-7" "24-8" "24-9" "24-10" "24-11" "24-12"
[217] "24-13" "24-14" "24-15" "24-16" "24-17" "24-18" "24-19" "24-20" "24-21"
[226] "24-22" "24-23" "24-24" "24-25" "24-26" "24-27" "24-28" "24-29" "24-30"
[235] "24-31" "24-32" "24-33" "24-34" "32-1" "32-2" "32-3" "32-4" "32-5"
[244] "32-6" "32-7" "32-8" "32-9" "32-10" "32-11" "32-12" "32-13" "32-14"
[253] "32-15" "32-16" "32-17" "32-18" "32-19" "32-20" "32-21" "32-22" "32-23"
[262] "32-24" "32-25" "32-26" "32-27" "32-28" "32-29" "32-30" "32-31" "32-32"
[271] "32-33" "32-34" "48-1" "48-2" "48-3" "48-4" "48-5" "48-6" "48-7"
[280] "48-8" "48-9" "48-10" "48-11" "48-12" "48-13" "48-14" "48-15" "48-16"
[289] "48-17" "48-18" "48-19" "48-20" "48-21" "48-22" "48-23" "48-24" "48-25"
[298] "48-26" "48-27" "48-28" "48-29" "48-30" "48-31" "48-32" "48-33" "48-34"
[307] "72-1" "72-2" "72-3" "72-4" "72-5" "72-6" "72-7" "72-8" "72-9"
[316] "72-10" "72-11" "72-12" "72-13" "72-14" "72-15" "72-16" "72-17" "72-18"
[325] "72-19" "72-20" "72-21" "72-22" "72-23" "72-24" "72-25" "72-26" "72-27"
[334] "72-28" "72-29" "72-30" "72-31" "72-32" "72-33" "72-34"
$dimnames[[2]]
[1] "RB1" "CCNG1" "TRAF5" "CLU" "MAPK9" "SIVA" "CD69"
[8] "ZNFN1A1" "IL4R" "MAP2K4" "JUND" "LCK" "SCYA2" "RPS6KA1"
[15] "ITGAM" "CTNNB1" "SMN1" "CASP8" "E2F4" "PCNA" "CCNC"
[22] "PDE4B" "IL16" "APC" "ID3" "SLA" "CDK4" "EGR1"
[29] "TCF12" "MCL1" "CDC2" "SOD1" "CCNA2" "PIG3" "IRAK1"
[36] "SKIIP" "MYD88" "CASP4" "TCF8" "API2" "GATA3" "RBL2"
[43] "C3X1" "IFNAR1" "FYB" "IL2RG" "CSF2RA" "MPO" "API1"
[50] "CYP19" "CIR" "CASP7" "MAP3K8" "JUNB" "IL3RA" "NFKBIA"
[57] "LAT" "AKT1"
$class
[1] "longitudinal"
$time
[1] 0 2 4 6 8 18 24 32 48 72
$repeats
[1] 34 34 34 34 34 34 34 34 34 34
RB1 CCNG1 TRAF5
0-1 17.56824 16.24913 17.26195
0-2 17.47407 16.31433 17.31736
0-3 17.51780 16.24913 17.37948
0-4 17.43198 16.18577 17.22650
0-5 17.47407 16.31433 17.37948
0-6 17.47407 16.18577 17.09170
0-7 17.47407 16.18577 17.04820
0-8 17.47407 16.18577 17.18715
0-9 17.43198 16.08763 17.18715
0-10 17.37948 16.18577 17.13411
0-11 17.47407 16.31433 17.18715
0-12 17.31736 16.31433 17.26195
0-13 17.43198 16.31433 17.37948
0-14 17.37948 16.31433 17.13411
0-15 17.62143 16.31433 17.26195
0-16 17.37948 16.18577 17.31736
0-17 17.62143 16.48956 17.31736
0-18 17.31736 16.89854 17.43198
0-19 17.37948 16.72855 17.31736
0-20 17.43198 16.67924 17.26195
0-21 17.43198 16.82623 17.13411
0-22 17.43198 16.89854 17.26195
0-23 17.51780 16.72855 17.77145
0-24 17.62143 16.40275 17.70533
0-25 17.43198 16.40275 17.62143
0-26 17.26195 16.55398 17.62143
0-27 17.31736 16.48956 17.70533
0-28 16.99275 16.67924 17.70533
0-29 17.18715 16.67924 17.77145
0-30 17.37948 16.55398 17.62143
0-31 17.43198 16.77960 17.86442
0-32 17.37948 16.82623 17.62143
0-33 17.31736 16.89854 17.51780
0-34 17.31736 16.93833 17.43198
2-1 17.87904 16.07596 17.05065
2-2 17.67242 15.97050 16.89879
2-3 17.72231 15.89064 16.89879
2-4 17.87904 15.76017 16.62259
2-5 17.76774 15.76017 16.89879
2-6 17.72231 16.07596 16.77237
2-7 17.67242 15.97050 16.72061
2-8 17.76774 15.89064 16.77237
2-9 17.60520 15.76017 16.82901
2-10 17.55000 15.97050 16.82901
2-11 17.55000 15.89064 16.89879
2-12 17.43418 15.97050 16.72061
2-13 17.43418 15.89064 16.89879
2-14 17.37293 16.15166 16.89879
2-15 17.76774 15.97050 16.82901
2-16 17.60520 16.21940 16.62259
2-17 17.72231 15.89064 16.97887
2-18 18.11664 16.66729 17.43418
2-19 17.55000 16.82901 17.05065
2-20 17.87904 16.77237 16.97887
2-21 17.72231 16.77237 17.05065
2-22 18.11664 16.82901 17.26281
2-23 17.87904 16.97887 17.37293
2-24 17.91617 16.42756 17.22198
2-25 17.72231 16.62259 17.17830
2-26 17.49665 16.42756 17.31687
2-27 17.72231 16.66729 17.11897
2-28 17.17830 16.48291 17.22198
2-29 16.97887 16.72061 17.22198
2-30 16.97887 16.82901 17.05065
2-31 17.26281 16.82901 17.31687
2-32 17.49665 16.82901 16.89879
2-33 17.55000 16.82901 17.37293
2-34 17.60520 16.97887 17.37293
4-1 17.86470 16.45780 17.25656
4-2 17.94904 15.96581 17.09645
4-3 18.04725 15.71863 17.01411
4-4 17.99995 15.81283 17.09645
4-5 17.90275 15.88505 17.09645
4-6 17.99995 16.31271 16.60527
4-7 18.04725 15.96581 16.82676
4-8 17.99995 15.96581 17.09645
4-9 18.08670 15.81283 17.09645
4-10 17.99995 15.88505 16.91588
4-11 18.08670 15.88505 17.09645
4-12 17.86470 15.96581 17.16883
4-13 17.82084 15.88505 17.16883
4-14 17.71347 15.88505 17.60533
4-15 17.94904 15.81283 17.09645
4-16 17.99995 16.04639 17.09645
4-17 17.82084 16.52203 17.01411
4-18 18.12387 16.60527 17.37045
4-19 17.71347 16.67798 17.25656
4-20 17.86470 16.82676 17.09645
4-21 17.94904 16.82676 17.09645
4-22 17.66863 16.91588 17.16883
4-23 17.86470 17.09645 17.42519
4-24 18.04725 16.45780 17.37045
4-25 17.66863 16.52203 17.42519
4-26 17.76400 16.45780 17.25656
4-27 17.86470 16.60527 17.42519
4-28 17.82084 16.12376 17.16883
4-29 17.90275 16.52203 17.37045
4-30 17.86470 16.45780 17.60533
4-31 17.76400 16.12376 17.60533
4-32 17.71347 16.22623 17.16883
4-33 17.86470 16.52203 17.31366
4-34 17.76400 16.31271 17.09645
6-1 17.56371 15.69870 16.48660
6-2 17.51270 15.46072 16.48660
6-3 17.51270 15.60066 16.38286
6-4 17.46655 15.75625 16.48660
6-5 17.42249 15.69870 16.42992
6-6 17.42249 15.60066 16.33751
6-7 17.37318 15.60066 16.33751
6-8 17.42249 15.69870 16.38286
6-9 17.46655 15.75625 16.38286
6-10 17.46655 15.75625 16.27031
6-11 17.42249 15.69870 16.33751
6-12 17.56371 15.60066 16.38286
6-13 17.46655 15.60066 16.38286
6-14 17.32694 15.81315 16.33751
6-15 17.46655 15.75625 16.27031
6-16 17.46655 15.93693 16.14107
6-17 17.46655 15.69870 16.33751
6-18 17.56371 16.33751 16.38286
6-19 17.23093 16.20948 16.38286
6-20 17.15103 16.33751 16.20948
6-21 17.42249 16.33751 16.27031
6-22 17.37318 16.27031 16.76873
6-23 17.15103 16.54300 17.08487
6-24 17.60920 15.69870 17.01578
6-25 17.15103 15.75625 17.01578
6-26 17.15103 16.14107 17.08487
6-27 17.32694 15.93693 16.94804
6-28 17.23093 15.81315 16.86482
6-29 17.23093 16.14107 16.86482
6-30 17.15103 16.33751 16.86482
6-31 17.23093 16.20948 16.94804
6-32 17.23093 16.38286 16.94804
6-33 17.32694 15.93693 16.76873
6-34 17.42249 16.14107 16.59571
8-1 17.59680 16.15871 17.65355
8-2 17.65355 16.15871 16.88974
8-3 17.70157 16.15871 17.08865
8-4 17.65355 16.08799 17.17970
8-5 17.59680 16.08799 16.96107
8-6 17.65355 16.15871 17.05404
8-7 17.46154 15.89573 17.05404
8-8 17.65355 17.13187 16.96107
8-9 17.59680 16.00954 17.22402
8-10 17.52716 16.24466 17.32380
8-11 17.59680 16.15871 17.17970
8-12 17.46154 16.24466 17.26942
8-13 17.59680 16.00954 17.22402
8-14 17.65355 16.59337 17.22402
8-15 17.65355 16.00954 17.08865
8-16 17.59680 16.68045 17.22402
8-17 17.70157 16.15871 17.32380
8-18 17.78953 16.24466 17.22402
8-19 17.32380 16.24466 17.13187
8-20 17.32380 16.68045 17.17970
8-21 17.37576 16.15871 17.08865
8-22 17.65355 16.59337 17.26942
8-23 17.59680 16.68045 17.37576
8-24 17.91431 15.73392 17.32380
8-25 17.52716 16.00954 17.17970
8-26 17.46154 15.89573 17.08865
8-27 17.52716 16.47732 17.26942
8-28 17.37576 16.00954 17.13187
8-29 17.46154 16.34124 17.13187
8-30 17.52716 16.15871 16.96107
8-31 17.52716 16.47732 17.37576
8-32 17.65355 16.00954 17.22402
8-33 17.75231 16.15871 17.17970
8-34 17.46154 16.88974 17.32380
18-1 17.82257 16.00100 17.15947
18-2 17.91759 16.08095 17.21421
18-3 17.82257 16.00100 17.15947
18-4 17.73708 16.00100 17.33937
18-5 17.70721 15.71836 17.66443
18-6 17.86141 16.00100 17.15947
18-7 17.86141 15.90003 17.15947
18-8 17.70721 16.86576 17.21421
18-9 17.70721 15.90003 17.15947
18-10 17.82257 16.40018 17.02655
18-11 17.73708 16.14562 17.21421
18-12 17.70721 16.52223 17.30330
18-13 17.86141 16.08095 17.21421
18-14 17.82257 16.65549 17.25904
18-15 17.86141 16.08095 17.21421
18-16 17.99434 16.25728 17.21421
18-17 17.86141 16.14562 17.21421
18-18 18.30793 16.08095 17.15947
18-19 18.30793 16.08095 17.15947
18-20 18.13219 16.40018 16.86576
18-21 17.99434 16.71029 16.65549
18-22 18.06096 16.25728 16.96390
18-23 17.73708 16.80651 17.21421
18-24 18.46946 16.08095 16.92222
18-25 17.70721 16.08095 17.15947
18-26 17.66443 16.14562 16.96390
18-27 17.82257 16.14562 17.30330
18-28 17.82257 16.65549 17.33937
18-29 17.91759 16.25728 17.25904
18-30 17.38883 16.40018 17.25904
18-31 17.77271 16.80651 17.30330
18-32 17.59690 16.52223 17.25904
18-33 17.99434 16.08095 17.25904
18-34 17.66443 16.71029 17.33937
24-1 17.80909 16.14432 17.14415
24-2 17.69030 16.20082 16.91451
24-3 17.76330 16.37127 17.21095
24-4 17.65005 16.29182 17.29857
24-5 17.65005 16.29182 17.45758
24-6 17.69030 16.20082 17.21095
24-7 17.72409 16.29182 17.14415
24-8 17.69030 16.50035 17.25965
24-9 17.65005 16.14432 17.21095
24-10 17.69030 16.20082 17.34452
24-11 17.53601 16.14432 18.30686
24-12 17.69030 16.50035 17.34452
24-13 17.76330 16.29182 17.29857
24-14 17.72409 16.43234 17.53601
24-15 17.72409 16.29182 17.56985
24-16 17.76330 16.20082 17.29857
24-17 17.69030 16.29182 17.34452
24-18 18.11951 15.99060 17.42056
24-19 17.95604 16.83604 17.21095
24-20 18.00271 15.99060 17.14415
24-21 18.17375 16.91451 17.21095
24-22 18.30686 15.92540 17.25965
24-23 18.53149 16.76673 17.69030
24-24 17.76330 15.92540 17.69030
24-25 17.69030 15.83495 17.61255
24-26 17.53601 16.37127 17.69030
24-27 17.72409 15.69812 17.76330
24-28 17.48834 16.37127 17.80909
24-29 17.69030 15.69812 17.72409
24-30 17.65005 16.29182 17.72409
24-31 17.72409 15.83495 17.48834
24-32 17.53601 16.57701 17.42056
24-33 17.56985 15.69812 17.37690
24-34 17.56985 16.68682 17.45758
32-1 17.45632 16.47580 16.65583
32-2 17.29456 16.54141 16.71803
32-3 17.23680 16.71803 16.80817
32-4 17.33645 16.38935 16.76347
32-5 17.23680 16.47580 16.84594
32-6 17.23680 16.38935 16.84594
32-7 17.17749 16.38935 16.99230
32-8 17.39321 16.71803 16.84594
32-9 17.09885 16.47580 16.71803
32-10 17.04472 16.71803 16.93232
32-11 17.17749 16.47580 16.76347
32-12 17.17749 16.60193 16.93232
32-13 17.14139 16.38935 16.84594
32-14 16.99230 16.54141 16.76347
32-15 17.04472 16.27851 16.71803
32-16 17.09885 16.60193 16.88360
32-17 17.17749 16.38935 16.80817
32-18 17.58806 16.02508 17.09885
32-19 17.33645 16.93232 16.76347
32-20 17.39321 15.89839 16.99230
32-21 17.53210 17.14139 16.65583
32-22 17.36538 16.15145 17.20674
32-23 17.33645 17.14139 17.20674
32-24 17.39321 16.38935 17.20674
32-25 17.17749 15.95930 16.93232
32-26 17.23680 16.80817 17.29456
32-27 17.09885 15.78380 17.23680
32-28 16.80817 17.04472 17.20674
32-29 17.26414 15.89839 17.04472
32-30 17.09885 16.99230 17.20674
32-31 17.23680 16.84594 17.04472
32-32 17.09885 17.20674 16.99230
32-33 17.14139 16.02508 17.09885
32-34 17.23680 16.88360 17.20674
48-1 16.92781 16.09338 17.10182
48-2 16.92781 16.09338 16.81078
48-3 16.81078 16.28694 16.92781
48-4 16.96479 16.01979 17.10182
48-5 16.76043 16.17007 16.96479
48-6 16.81078 16.01979 17.01051
48-7 16.96479 16.09338 17.19908
48-8 16.88507 16.35656 17.15202
48-9 16.76043 16.23068 17.19908
48-10 16.76043 16.23068 17.15202
48-11 16.92781 16.17007 17.01051
48-12 16.81078 16.17007 17.41115
48-13 16.92781 16.17007 17.15202
48-14 16.76043 16.28694 17.15202
48-15 16.85396 16.28694 17.10182
48-16 16.66096 16.23068 17.15202
48-17 16.70826 16.01979 17.10182
48-18 16.96479 16.17007 17.15202
48-19 16.92781 16.23068 16.85396
48-20 17.15202 15.78324 16.76043
48-21 17.01051 16.49724 16.70826
48-22 17.19908 15.95759 17.01051
48-23 16.85396 16.62101 17.41115
48-24 17.01051 15.87018 17.41115
48-25 16.70826 15.71449 17.10182
48-26 16.70826 16.17007 17.25874
48-27 16.88507 15.95759 17.25874
48-28 16.76043 16.28694 17.10182
48-29 16.70826 15.91334 17.10182
48-30 16.76043 16.23068 17.19908
48-31 16.88507 16.17007 17.19908
48-32 16.81078 16.28694 17.19908
48-33 16.96479 15.71449 17.10182
48-34 16.81078 16.35656 17.01051
72-1 16.74373 16.61163 16.90140
72-2 17.07053 16.39790 16.98320
72-3 17.07053 16.64824 17.02767
72-4 17.11684 16.33512 17.23530
72-5 16.93980 16.74373 17.45014
72-6 17.11684 16.18767 17.31811
72-7 17.07053 16.46533 17.31811
72-8 17.07053 16.80062 17.40216
72-9 16.98320 16.51820 17.28422
72-10 16.90140 16.64824 17.45014
72-11 17.02767 16.39790 17.31811
72-12 17.11684 16.90140 17.45014
72-13 17.11684 16.70097 17.35739
72-14 17.07053 16.90140 17.54584
72-15 17.20063 16.51820 17.35739
72-16 17.07053 16.93980 17.54584
72-17 17.15695 16.74373 17.45014
72-18 17.02767 15.90861 17.40216
72-19 17.20063 16.85213 17.15695
72-20 17.11684 16.39790 16.93980
72-21 17.20063 16.93980 16.55357
72-22 17.11684 15.90861 17.35739
72-23 16.98320 16.85213 18.07517
72-24 17.31811 16.46533 17.59871
72-25 17.15695 15.90861 17.59871
72-26 17.28422 16.74373 17.65602
72-27 17.20063 16.90140 17.59871
72-28 17.15695 16.85213 17.59871
72-29 16.80062 16.26782 17.54584
72-30 17.28422 16.85213 17.35739
72-31 17.28422 16.98320 17.79030
72-32 16.93980 17.02767 17.59871
72-33 17.23530 15.90861 17.49438
72-34 17.02767 16.80062 17.59871
[1] 340 58
Longitudinal data:
58 variables measured at 10 different time points
Total number of measurements per variable: 340
Repeated measurements: yes
To obtain the measurement design call 'get.time.repeats()'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.