library(data.table)
library(lubridate)
x <- new("Period", .Data = c(29, 6, 48, 10, 44, 35, 52, 0, 29, 47,
30, 51, 3, 12, 11, 49, 59, 48, 23, 44, 8, 44, 9, 15, 19, 6, 14,
59, 29, 20, 15, 50, 0, 10, 7, 49, 26, 24, 45, 18, 48, 36, 28,
50, 40, 50, 19, 51, 8, 34, 45, 59, 27, 0, 5, 52, 5, 30, 14, 41,
49, 48, 20, 7, 6, 11, 35, 4, 8, 6, 0, 0, 44, 13, 44, 31, 27,
26, 49, 10, 5, 7, 26, 38, 0, 0, 42, 24, 52, 23, 15, 13, 59, 30,
7, 52, 32, 27, 15, 54, 13, 19, 8, 33, 3, 47, 26, 42), year = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0), month = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0), day = c(0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), hour = c(1, 14,
0, 3, 7, 10, 6, 0, 0, 2, 4, 1, 0, 5, 7, 14, 10, 0, 13, 3, 1,
7, 11, 8, 0, 14, 9, 14, 18, 0, 0, 8, 0, 10, 0, 6, 14, 7, 0, 20,
8, 12, 0, 0, 0, 0, 14, 13, 17, 14, 8, 0, 15, 0, 12, 0, 13, 16,
5, 0, 6, 9, 7, 0, 6, 15, 1, 16, 13, 13, 0, 0, 7, 5, 16, 0, 13,
0, 0, 3, 18, 16, 7, 0, 0, 14, 4, 4, 0, 10, 2, 10, 13, 0, 22,
1, 18, 3, 15, 14, 10, 0, 23, 7, 2, 0, 7, 1), minute = c(5, 6,
53, 40, 0, 30, 18, 0, 4, 43, 55, 16, 6, 0, 35, 45, 37, 19, 14,
44, 12, 1, 43, 37, 22, 52, 6, 36, 46, 11, 30, 44, 0, 23, 5, 52,
57, 7, 49, 8, 58, 25, 46, 24, 5, 14, 34, 50, 53, 31, 10, 5, 30,
0, 29, 0, 43, 18, 3, 8, 20, 39, 56, 1, 50, 51, 41, 5, 51, 28,
0, 0, 23, 0, 15, 0, 40, 49, 2, 3, 25, 47, 55, 1, 0, 40, 40, 32,
21, 58, 41, 55, 45, 12, 44, 12, 15, 30, 58, 6, 40, 13, 40, 59,
48, 11, 41, 25))
У меня есть топор-вектор периодов следующим образом
x
[1] "1H 5M 29S" "14H 6M 6S" "53M 48S" "3H 40M 10S" "7H 0M 44S" "10H 30M 35S" "6H 18M 52S" "0S"
[9] "4M 29S" "2H 43M 47S" "4H 55M 30S" "1H 16M 51S" "6M 3S" "5H 0M 12S" "7H 35M 11S" "14H 45M 49S"
[17] "10H 37M 59S" "19M 48S" "13H 14M 23S" "3H 44M 44S" "1H 12M 8S" "7H 1M 44S" "11H 43M 9S" "8H 37M 15S"
[25] "1d 0H 22M 19S" "14H 52M 6S" "9H 6M 14S" "14H 36M 59S" "18H 46M 29S" "11M 20S" "30M 15S" "8H 44M 50S"
[33] "0S" "10H 23M 10S" "5M 7S" "6H 52M 49S" "14H 57M 26S" "7H 7M 24S" "49M 45S" "20H 8M 18S"
[41] "8H 58M 48S" "12H 25M 36S" "46M 28S" "24M 50S" "5M 40S" "14M 50S" "14H 34M 19S" "13H 50M 51S"
[49] "17H 53M 8S" "14H 31M 34S" "8H 10M 45S" "5M 59S" "15H 30M 27S" "0S" "12H 29M 5S" "52S"
[57] "13H 43M 5S" "16H 18M 30S" "5H 3M 14S" "8M 41S" "6H 20M 49S" "9H 39M 48S" "7H 56M 20S" "1M 7S"
[65] "6H 50M 6S" "15H 51M 11S" "1H 41M 35S" "16H 5M 4S" "13H 51M 8S" "13H 28M 6S" "0S" "0S"
[73] "7H 23M 44S" "5H 0M 13S" "16H 15M 44S" "31S" "13H 40M 27S" "49M 26S" "2M 49S" "3H 3M 10S"
[81] "18H 25M 5S" "16H 47M 7S" "7H 55M 26S" "1M 38S" "0S" "14H 40M 0S" "4H 40M 42S" "4H 32M 24S"
[89] "21M 52S" "10H 58M 23S" "2H 41M 15S" "10H 55M 13S" "13H 45M 59S" "12M 30S" "22H 44M 7S" "1H 12M 52S"
[97] "18H 15M 32S" "3H 30M 27S" "15H 58M 15S" "14H 6M 54S" "10H 40M 13S" "13M 19S" "23H 40M 8S" "7H 59M 33S"
[105] "2H 48M 3S" "11M 47S" "7H 41M 26S" "1H 25M 42S"
Однако он не работает с таблицей данных, но работает с данными. Кадр, в чем проблема и как ее решить .
data.table(time = x)
data.frame(time = x)
Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent