Преобразование символа четверти в объект даты в R - PullRequest
0 голосов
/ 16 июня 2020

У меня есть набор данных и столбец с информацией о «периоде» наблюдений, который является символом для кварталов года. Столбец выглядит так:

> dput(df$Period)
structure(c(27L, 40L, 1L, 3L, 15L, 42L, 29L, 35L, 21L, 48L, 9L, 
41L, 28L, 2L, 14L, 45L, 32L, 18L, 6L, 22L, 49L, 36L, 10L, 27L, 
1L, 40L, 2L, 41L, 14L, 28L, 15L, 3L, 42L, 29L, 6L, 32L, 45L, 
18L, 48L, 21L, 35L, 9L, 10L, 49L, 22L, 36L, 2L, 41L, 28L, 14L, 
45L, 6L, 18L, 32L, 10L, 49L, 22L, 36L, 18L, 6L, 45L, 32L, 49L, 
36L, 22L, 10L, 14L, 2L, 41L, 28L, 45L, 18L, 32L, 6L, 49L, 10L, 
22L, 36L, 32L, 18L, 45L, 6L, 36L, 10L, 22L, 49L, 14L, 41L, 28L, 
2L, 27L, 40L, 1L, 35L, 9L, 48L, 21L, 27L, 40L, 1L, 35L, 21L, 
48L, 9L, 1L, 40L, 27L, 41L, 28L, 2L, 14L, 42L, 15L, 3L, 29L, 
32L, 45L, 6L, 18L, 48L, 9L, 21L, 35L, 10L, 49L, 36L, 22L, 1L, 
40L, 27L, 14L, 28L, 41L, 2L, 29L, 15L, 42L, 3L, 18L, 6L, 32L, 
45L, 49L, 36L, 22L, 10L, 27L, 1L, 40L, 2L, 41L, 28L, 14L, 15L, 
42L, 29L, 3L, 6L, 45L, 18L, 32L, 7L, 19L, 46L, 33L, 9L, 35L, 
21L, 48L, 10L, 22L, 49L, 36L, 1L, 40L, 27L, 2L, 14L, 28L, 41L, 
3L, 42L, 15L, 29L, 18L, 32L, 45L, 6L, 46L, 33L, 19L, 7L, 35L, 
9L, 21L, 48L, 49L, 22L, 36L, 10L, 1L, 27L, 40L, 29L, 15L, 3L, 
42L, 45L, 6L, 18L, 32L, 9L, 21L, 35L, 48L, 36L, 49L, 10L, 22L, 
2L, 28L, 14L, 41L, 32L, 18L, 45L, 6L, 36L, 49L, 22L, 10L, 1L, 
27L, 40L, 43L, 30L, 16L, 4L, 44L, 31L, 17L, 5L, 32L, 18L, 45L, 
6L, 49L, 36L, 22L, 10L, 27L, 40L, 1L, 9L, 35L, 21L, 48L, 27L, 
1L, 40L, 2L, 41L, 28L, 14L, 42L, 29L, 15L, 3L, 18L, 6L, 32L, 
45L, 46L, 7L, 19L, 33L, 48L, 21L, 9L, 35L, 36L, 10L, 22L, 49L, 
14L, 28L, 41L, 2L, 32L, 6L, 18L, 45L, 22L, 10L, 49L, 36L, 40L, 
1L, 27L, 14L, 41L, 28L, 2L, 42L, 29L, 15L, 3L, 6L, 18L, 45L, 
32L, 33L, 19L, 7L, 46L, 9L, 48L, 35L, 21L, 36L, 49L, 10L, 22L, 
41L, 28L, 2L, 14L, 18L, 6L, 45L, 32L, 36L, 22L, 49L, 10L, 41L, 
2L, 28L, 14L, 45L, 18L, 6L, 32L, 22L, 36L, 49L, 10L, 40L, 27L, 
1L, 28L, 41L, 2L, 14L, 3L, 15L, 29L, 42L, 32L, 18L, 6L, 45L, 
35L, 21L, 48L, 9L, 36L, 22L, 10L, 49L, 32L, 45L, 6L, 18L, 10L, 
22L, 49L, 36L, 41L, 28L, 14L, 2L, 45L, 18L, 6L, 32L, 36L, 49L, 
10L, 22L, 28L, 2L, 41L, 14L, 45L, 6L, 32L, 18L, 22L, 36L, 10L, 
49L, 27L, 1L, 40L, 14L, 2L, 28L, 41L, 42L, 3L, 29L, 15L, 17L, 
44L, 31L, 5L, 6L, 32L, 18L, 45L, 9L, 48L, 35L, 21L, 36L, 22L, 
10L, 49L, 2L, 14L, 41L, 28L, 32L, 18L, 45L, 6L, 49L, 22L, 10L, 
36L, 41L, 28L, 14L, 2L, 6L, 45L, 32L, 18L, 22L, 10L, 49L, 36L, 
40L, 1L, 27L, 35L, 21L, 9L, 48L, 1L, 40L, 27L, 14L, 2L, 28L, 
41L, 29L, 3L, 15L, 42L, 6L, 45L, 32L, 18L, 46L, 7L, 33L, 19L, 
21L, 9L, 35L, 48L, 36L, 10L, 22L, 49L, 28L, 41L, 2L, 14L, 18L, 
6L, 45L, 32L, 36L, 22L, 49L, 10L, 1L, 40L, 27L, 28L, 14L, 41L, 
2L, 16L, 30L, 43L, 4L, 45L, 6L, 32L, 18L, 20L, 8L, 47L, 34L, 
9L, 35L, 48L, 21L, 22L, 36L, 49L, 10L, 41L, 2L, 28L, 14L, 18L, 
32L, 45L, 6L, 49L, 22L, 10L, 36L, 27L, 1L, 40L, 48L, 35L, 9L, 
21L, 14L, 2L, 41L, 28L, 6L, 45L, 18L, 32L, 36L, 49L, 10L, 22L, 
40L, 1L, 27L, 41L, 2L, 28L, 14L, 42L, 3L, 15L, 29L, 17L, 31L, 
44L, 5L, 32L, 18L, 45L, 6L, 46L, 33L, 19L, 7L, 9L, 35L, 21L, 
48L, 36L, 49L, 10L, 22L, 6L, 18L, 32L, 45L, 10L, 49L, 22L, 36L, 
1L, 27L, 40L, 2L, 41L, 28L, 14L, 42L, 29L, 15L, 3L, 18L, 32L, 
45L, 6L, 46L, 7L, 33L, 19L, 48L, 21L, 9L, 35L, 49L, 10L, 22L, 
36L, 27L, 1L, 40L, 2L, 28L, 14L, 41L, 15L, 3L, 42L, 29L, 45L, 
32L, 6L, 18L, 9L, 35L, 48L, 21L, 10L, 36L, 49L, 22L, 40L, 1L, 
27L, 41L, 28L, 14L, 2L, 42L, 15L, 29L, 3L, 32L, 6L, 45L, 18L, 
46L, 19L, 33L, 7L, 35L, 9L, 21L, 48L, 10L, 22L, 36L, 49L, 27L, 
1L, 40L, 41L, 14L, 2L, 28L, 29L, 3L, 15L, 42L, 44L, 31L, 17L, 
5L, 6L, 18L, 32L, 45L, 7L, 46L, 33L, 19L, 21L, 35L, 9L, 48L, 
22L, 49L, 36L, 10L, 1L, 40L, 27L, 35L, 48L, 9L, 21L, 27L, 1L, 
40L, 2L, 28L, 41L, 14L, 42L, 29L, 3L, 15L, 18L, 6L, 32L, 45L, 
7L, 33L, 46L, 19L, 9L, 21L, 35L, 48L, 36L, 22L, 10L, 49L, 41L, 
2L, 14L, 28L, 18L, 6L, 45L, 32L, 10L, 22L, 49L, 36L, 1L, 40L, 
27L, 28L, 14L, 41L, 2L, 42L, 29L, 3L, 15L, 18L, 32L, 45L, 6L, 
7L, 33L, 19L, 46L, 35L, 48L, 9L, 21L, 49L, 36L, 22L, 10L, 40L, 
1L, 27L, 41L, 2L, 14L, 28L, 15L, 3L, 29L, 42L, 45L, 32L, 6L, 
18L, 19L, 7L, 33L, 46L, 21L, 48L, 9L, 35L, 36L, 22L, 49L, 10L, 
4L, 30L, 43L, 18L, 45L, 32L, 6L, 10L, 36L, 49L, 22L, 28L, 2L, 
41L, 14L, 45L, 32L, 6L, 18L, 22L, 36L, 49L, 10L, 41L, 28L, 2L, 
14L, 45L, 6L, 32L, 18L, 22L, 36L, 49L, 10L, 27L, 1L, 40L, 3L, 
15L, 29L, 42L, 46L, 7L, 33L, 19L, 9L, 35L, 21L, 48L, 27L, 40L, 
1L, 2L, 14L, 41L, 28L, 15L, 3L, 42L, 29L, 32L, 6L, 18L, 45L, 
7L, 19L, 33L, 46L, 35L, 9L, 21L, 48L, 36L, 49L, 22L, 10L, 6L, 
45L, 18L, 32L, 22L, 36L, 49L, 10L, 45L, 32L, 18L, 6L, 10L, 22L, 
49L, 36L, 27L, 40L, 1L, 41L, 28L, 2L, 14L, 45L, 6L, 18L, 32L, 
36L, 49L, 10L, 22L, 14L, 41L, 28L, 2L, 18L, 32L, 45L, 6L, 49L, 
10L, 22L, 36L, 6L, 45L, 32L, 18L, 22L, 27L, 1L, 40L, 2L, 41L, 
28L, 14L, 3L, 42L, 15L, 29L, 45L, 6L, 32L, 18L, 46L, 7L, 19L, 
33L, 48L, 35L, 21L, 9L, 49L, 10L, 22L, 36L, 31L, 17L, 44L, 5L, 
18L, 40L, 1L, 27L, 2L, 14L, 41L, 28L, 42L, 3L, 29L, 15L, 18L, 
6L, 45L, 32L, 19L, 7L, 46L, 33L, 21L, 35L, 48L, 9L, 22L, 10L, 
49L, 36L, 1L, 27L, 40L, 41L, 2L, 28L, 14L, 6L, 32L, 45L, 18L, 
10L, 22L, 36L, 49L, 32L, 18L, 45L, 6L, 49L, 22L, 36L, 10L, 43L, 
4L, 30L, 41L, 14L, 2L, 28L, 6L, 32L, 18L, 45L, 22L, 10L, 36L, 
49L, 27L, 1L, 40L, 42L, 15L, 29L, 3L, 31L, 5L, 44L, 17L, 45L, 
6L, 32L, 18L, 35L, 9L, 21L, 48L, 49L, 36L, 10L, 22L, 1L, 40L, 
27L, 28L, 14L, 2L, 41L, 42L, 15L, 3L, 29L, 6L, 32L, 45L, 18L, 
9L, 35L, 48L, 21L, 10L, 36L, 22L, 49L, 40L, 27L, 1L, 27L, 1L, 
40L, 48L, 21L, 35L, 9L, 41L, 2L, 14L, 28L, 18L, 45L, 32L, 6L, 
10L, 22L, 36L, 49L, 41L, 28L, 2L, 14L, 18L, 45L, 32L, 6L, 22L, 
49L, 36L, 10L, 14L, 41L, 2L, 28L, 6L, 32L, 18L, 45L, 22L, 10L, 
49L, 36L, 1L, 27L, 40L, 42L, 29L, 3L, 15L, 18L, 32L, 6L, 45L, 
19L, 46L, 7L, 33L, 9L, 35L, 48L, 21L, 22L, 10L, 36L, 49L, 1L, 
27L, 40L, 28L, 2L, 41L, 14L, 3L, 42L, 15L, 29L, 17L, 44L, 31L, 
5L, 45L, 18L, 6L, 32L, 46L, 7L, 33L, 19L, 35L, 21L, 9L, 48L, 
10L, 36L, 49L, 22L, 2L, 41L, 28L, 14L, 45L, 32L, 6L, 18L, 49L, 
10L, 22L, 36L, 40L, 27L, 1L, 2L, 41L, 28L, 14L, 29L, 42L, 3L, 
15L, 45L, 32L, 18L, 6L, 48L, 9L, 35L, 21L, 49L, 10L, 22L, 36L, 
14L, 28L, 2L, 41L, 18L, 45L, 32L, 6L, 49L, 10L, 36L, 22L, 27L, 
40L, 1L, 41L, 14L, 2L, 28L, 29L, 15L, 3L, 42L, 32L, 6L, 18L, 
45L, 9L, 35L, 21L, 48L, 10L, 22L, 36L, 49L, 3L, 15L, 42L, 29L, 
40L, 27L, 1L, 48L, 35L, 9L, 21L, 14L, 2L, 41L, 28L, 45L, 32L, 
6L, 18L, 49L, 10L, 36L, 22L, 18L, 45L, 32L, 6L, 36L, 22L, 49L, 
10L, 18L, 2L, 41L, 28L, 14L, 32L, 45L, 18L, 6L, 36L, 49L, 22L, 
10L, 2L, 28L, 14L, 41L, 32L, 6L, 18L, 45L, 22L, 36L, 49L, 10L, 
45L, 18L, 32L, 6L, 10L, 36L, 49L, 22L, 32L, 18L, 6L, 45L, 49L, 
10L, 22L, 36L, 41L, 14L, 28L, 2L, 18L, 6L, 45L, 32L, 36L, 22L, 
10L, 49L, 40L, 27L, 1L, 45L, 32L, 18L, 6L, 49L, 10L, 36L, 22L, 
40L, 27L, 1L, 2L, 41L, 28L, 14L, 29L, 3L, 42L, 15L, 18L, 6L, 
45L, 32L, 33L, 19L, 46L, 7L, 21L, 9L, 48L, 35L, 49L, 10L, 36L, 
22L, 28L, 2L, 41L, 14L, 17L, 44L, 31L, 5L, 18L, 32L, 45L, 6L, 
10L, 49L, 36L, 22L, 27L, 40L, 1L, 27L, 1L, 40L, 41L, 28L, 14L, 
2L, 42L, 15L, 29L, 3L, 5L, 17L, 31L, 44L, 45L, 32L, 6L, 18L, 
46L, 7L, 33L, 19L, 48L, 9L, 21L, 35L, 49L, 10L, 36L, 27L, 1L, 
40L, 48L, 9L, 21L, 35L, 40L, 1L, 27L, 2L, 28L, 14L, 41L, 42L, 
3L, 29L, 15L, 6L, 32L, 45L, 18L, 46L, 33L, 19L, 7L, 48L, 9L, 
21L, 35L, 10L, 22L, 36L, 49L, 2L, 14L, 28L, 41L, 45L, 6L, 32L, 
18L, 10L, 49L, 22L, 36L, 14L, 41L, 2L, 28L, 18L, 45L, 6L, 32L, 
10L, 49L, 22L, 36L, 40L, 1L, 27L, 42L, 15L, 3L, 29L, 45L, 18L, 
6L, 32L, 7L, 33L, 19L, 46L, 21L, 9L, 48L, 35L, 36L, 10L, 22L, 
49L, 40L, 1L, 27L, 3L, 29L, 15L, 42L, 46L, 19L, 33L, 7L, 48L, 
21L, 9L, 35L, 41L, 14L, 28L, 2L, 32L, 18L, 6L, 45L, 49L, 36L, 
22L, 10L, 28L, 2L, 41L, 14L, 6L, 32L, 45L, 18L, 36L, 10L, 22L, 
49L, 41L, 2L, 28L, 14L, 32L, 18L, 45L, 6L, 36L, 22L, 49L, 10L, 
14L, 28L, 2L, 41L, 32L, 45L, 18L, 6L, 10L, 36L, 22L, 49L, 27L, 
40L, 1L, 28L, 41L, 14L, 2L, 42L, 29L, 15L, 3L, 6L, 45L, 18L, 
32L, 9L, 35L, 48L, 21L, 22L, 10L, 36L, 49L, 18L, 6L, 45L, 32L, 
22L, 10L, 49L, 36L, 27L, 1L, 40L, 28L, 14L, 41L, 2L, 29L, 42L, 
15L, 3L, 6L, 45L, 32L, 18L, 33L, 46L, 19L, 7L, 21L, 48L, 9L, 
35L, 36L, 49L, 10L, 22L, 27L, 40L, 1L, 42L, 15L, 3L, 29L, 46L, 
19L, 7L, 33L, 9L, 35L, 48L, 21L, 28L, 41L, 2L, 14L, 45L, 6L, 
32L, 18L, 10L, 36L, 22L, 49L, 1L, 27L, 40L, 14L, 2L, 28L, 41L, 
15L, 3L, 29L, 42L, 18L, 32L, 45L, 6L, 7L, 33L, 46L, 19L, 48L, 
35L, 9L, 21L, 49L, 10L, 22L, 36L, 40L, 1L, 27L, 48L, 35L, 21L, 
9L, 14L, 28L, 41L, 2L, 6L, 45L, 18L, 32L, 49L, 36L, 10L, 22L, 
40L, 27L, 1L, 48L, 21L, 9L, 35L, 27L, 40L, 1L, 28L, 14L, 2L, 
41L, 42L, 29L, 15L, 3L, 32L, 45L, 18L, 6L, 21L, 9L, 48L, 35L, 
36L, 49L, 10L, 22L, 6L, 32L, 18L, 45L, 49L, 22L, 36L, 10L, 27L, 
1L, 40L, 48L, 35L, 21L, 9L, 28L, 14L, 41L, 2L, 32L, 18L, 45L, 
6L, 22L, 36L, 10L, 49L, 1L, 40L, 27L, 35L, 48L, 9L, 21L, 1L, 
27L, 40L, 14L, 28L, 2L, 41L, 15L, 42L, 3L, 29L, 6L, 45L, 32L, 
18L, 19L, 33L, 46L, 7L, 48L, 9L, 21L, 35L, 10L, 22L, 36L, 49L, 
40L, 1L, 27L, 3L, 29L, 15L, 42L, 6L, 18L, 45L, 32L, 7L, 19L, 
33L, 46L, 35L, 21L, 48L, 9L, 10L, 22L, 49L, 36L, 40L, 1L, 27L, 
21L, 35L, 9L, 48L, 1L, 40L, 27L, 14L, 2L, 41L, 28L, 15L, 29L, 
3L, 42L, 44L, 31L, 5L, 17L, 45L, 18L, 6L, 32L, 46L, 33L, 7L, 
19L, 9L, 21L, 48L, 35L, 36L, 22L, 49L, 10L, 40L, 1L, 27L, 41L, 
2L, 28L, 14L, 3L, 29L, 42L, 15L, 6L, 32L, 18L, 45L, 7L, 19L, 
33L, 46L, 21L, 9L, 48L, 35L, 22L, 10L, 36L, 49L, 40L, 1L, 27L, 
42L, 29L, 15L, 3L, 46L, 33L, 19L, 7L, 35L, 9L, 21L, 48L, 27L, 
40L, 1L, 41L, 14L, 28L, 2L, 42L, 15L, 3L, 29L, 32L, 6L, 45L, 
18L, 7L, 46L, 33L, 19L, 21L, 9L, 48L, 35L, 49L, 10L, 36L, 22L, 
27L, 40L, 1L, 9L, 35L, 21L, 48L, 2L, 41L, 14L, 28L, 6L, 45L, 
18L, 32L, 36L, 10L, 49L, 22L, 40L, 27L, 1L, 14L, 41L, 28L, 2L, 
29L, 15L, 3L, 42L, 18L, 32L, 6L, 45L, 7L, 33L, 19L, 46L, 21L, 
35L, 9L, 48L, 49L, 10L, 36L, 22L, 14L, 2L, 41L, 28L, 45L, 6L, 
32L, 18L, 49L, 36L, 22L, 10L, 1L, 27L, 40L, 48L, 35L, 9L, 21L, 
18L, 32L, 6L, 45L, 10L, 22L, 36L, 49L, 28L, 2L, 14L, 41L, 6L, 
45L, 18L, 32L, 10L, 22L, 49L, 36L, 27L, 40L, 1L, 9L, 35L, 21L, 
48L, 1L, 27L, 40L, 41L, 14L, 28L, 2L, 29L, 15L, 42L, 3L, 18L, 
32L, 45L, 6L, 19L, 7L, 33L, 46L, 9L, 35L, 21L, 48L, 49L, 22L, 
10L, 36L, 27L, 1L, 40L, 14L, 28L, 2L, 41L, 29L, 3L, 42L, 15L, 
32L, 6L, 45L, 18L, 33L, 46L, 19L, 7L, 9L, 21L, 35L, 48L, 10L, 
22L, 49L, 36L, 40L, 27L, 1L, 2L, 28L, 41L, 14L, 15L, 29L, 42L, 
3L, 6L, 32L, 45L, 18L, 21L, 35L, 9L, 48L, 22L, 49L, 36L, 10L, 
30L, 43L, 16L, 4L, 30L, 43L, 4L, 16L, 1L, 40L, 27L, 48L, 9L, 
35L, 21L, 45L, 32L, 6L, 18L, 10L, 22L, 36L, 49L, 1L, 27L, 40L, 
41L, 14L, 2L, 28L, 42L, 15L, 29L, 3L, 45L, 6L, 32L, 18L, 21L, 
9L, 48L, 35L, 36L, 10L, 49L, 22L, 27L, 1L, 40L, 28L, 2L, 14L, 
41L, 15L, 29L, 3L, 42L, 31L, 44L, 17L, 5L, 6L, 45L, 32L, 18L, 
48L, 35L, 9L, 21L, 22L, 10L, 49L, 36L, 40L, 1L, 27L, 9L, 48L, 
35L, 21L, 41L, 28L, 2L, 14L, 18L, 6L, 45L, 32L, 49L, 10L, 36L, 
22L, 27L, 40L, 1L, 28L, 41L, 14L, 2L, 29L, 3L, 42L, 15L, 45L, 
6L, 18L, 32L, 19L, 46L, 7L, 33L, 9L, 21L, 48L, 35L, 36L, 10L, 
22L, 49L, 28L, 41L, 14L, 2L, 18L, 32L, 45L, 6L, 22L, 36L, 10L, 
49L, 32L, 45L, 18L, 6L, 49L, 10L, 22L, 36L, 27L, 1L, 40L, 35L, 
48L, 21L, 9L, 41L, 14L, 2L, 28L, 18L, 45L, 6L, 32L, 49L, 36L, 
22L, 10L, 1L, 27L, 40L, 29L, 3L, 15L, 42L, 18L, 32L, 6L, 45L, 
46L, 33L, 7L, 19L, 9L, 48L, 35L, 21L, 22L, 10L, 36L, 49L, 27L, 
1L, 40L, 2L, 41L, 14L, 28L, 42L, 15L, 3L, 29L, 45L, 18L, 32L, 
6L, 19L, 7L, 46L, 33L, 21L, 48L, 9L, 35L, 22L, 10L, 36L, 49L, 
2L, 41L, 14L, 28L, 18L, 45L, 32L, 6L, 36L, 49L, 22L, 10L, 27L, 
40L, 1L, 40L, 27L, 1L, 14L, 28L, 41L, 2L, 3L, 15L, 42L, 29L, 
32L, 6L, 18L, 45L, 46L, 33L, 19L, 7L, 21L, 35L, 9L, 48L, 10L, 
36L, 49L, 22L, 41L, 28L, 2L, 14L, 45L, 18L, 6L, 32L, 10L, 36L, 
49L, 22L, 41L, 14L, 28L, 2L, 6L, 18L, 32L, 45L, 10L, 22L, 36L, 
49L, 1L, 40L, 27L, 14L, 28L, 41L, 2L, 15L, 42L, 3L, 29L, 45L, 
32L, 6L, 18L, 7L, 19L, 46L, 33L, 48L, 9L, 21L, 35L, 49L, 22L, 
36L, 10L, 45L, 18L, 32L, 6L, 10L, 36L, 22L, 49L, 14L, 28L, 41L, 
2L, 18L, 32L, 6L, 45L, 22L, 36L, 10L, 49L, 18L, 32L, 6L, 45L, 
10L, 36L, 49L, 22L, 18L, 32L, 6L, 45L, 49L, 36L, 22L, 10L, 27L, 
40L, 1L, 9L, 21L, 48L, 35L, 18L, 32L, 45L, 6L, 22L, 10L, 49L, 
36L, 28L, 2L, 14L, 41L, 6L, 32L, 45L, 18L, 10L, 49L, 22L, 36L, 
2L, 14L, 41L, 28L, 18L, 32L, 6L, 45L, 36L, 10L, 49L, 22L, 2L, 
28L, 14L, 41L, 32L, 6L, 18L, 45L, 10L, 49L, 22L, 36L, 40L, 27L, 
1L, 14L, 41L, 2L, 28L, 29L, 3L, 15L, 42L, 6L, 45L, 32L, 18L, 
46L, 7L, 33L, 19L, 35L, 21L, 9L, 48L, 36L, 10L, 22L, 49L, 40L, 
1L, 27L, 41L, 14L, 28L, 2L, 3L, 29L, 42L, 15L, 18L, 32L, 6L, 
45L, 7L, 33L, 19L, 46L, 9L, 21L, 48L, 35L, 22L, 10L, 49L, 36L, 
2L, 14L, 41L, 28L, 45L, 6L, 18L, 32L, 22L, 49L, 36L, 10L, 45L, 
18L, 32L, 6L, 49L, 10L, 36L, 22L, 1L, 27L, 40L, 14L, 41L, 28L, 
2L, 15L, 3L, 29L, 42L, 32L, 18L, 45L, 6L, 7L, 46L, 33L, 19L, 
48L, 9L, 21L, 35L, 49L, 36L, 10L, 22L, 40L, 1L, 27L, 9L, 35L, 
48L, 21L, 45L, 32L, 18L, 6L, 22L, 10L, 36L, 49L, 18L, 2L, 14L, 
28L, 41L, 6L, 18L, 32L, 45L, 22L, 49L, 36L, 10L, 27L, 1L, 40L, 
41L, 28L, 2L, 14L, 3L, 15L, 42L, 29L, 6L, 32L, 18L, 45L, 7L, 
46L, 33L, 19L, 9L, 48L, 35L, 21L, 49L, 36L, 22L, 10L, 40L, 1L, 
27L, 14L, 2L, 41L, 28L, 3L, 29L, 15L, 42L, 18L, 6L, 32L, 45L, 
33L, 19L, 46L, 7L, 48L, 21L, 9L, 35L, 22L, 36L, 10L, 49L, 45L, 
18L, 6L, 32L, 36L, 49L, 22L, 10L, 41L, 14L, 28L, 2L, 6L, 45L, 
18L, 32L, 49L, 10L, 22L, 36L, 2L, 14L, 41L, 28L, 45L, 6L, 32L, 
18L, 36L, 49L, 10L, 22L, 2L, 14L, 28L, 41L, 45L, 32L, 18L, 6L, 
10L, 36L, 49L, 22L, 1L, 27L, 40L, 41L, 2L, 28L, 14L, 42L, 29L, 
15L, 3L, 32L, 18L, 45L, 6L, 21L, 35L, 9L, 48L, 36L, 10L, 49L, 
22L, 28L, 2L, 41L, 14L, 18L, 32L, 6L, 45L, 49L, 10L, 36L, 22L, 
6L, 45L, 18L, 32L, 22L, 49L, 36L, 10L, 45L, 6L, 18L, 32L, 22L, 
49L, 36L, 10L, 31L, 5L, 17L, 44L, 1L, 27L, 40L, 28L, 2L, 41L, 
14L, 42L, 29L, 15L, 3L, 45L, 18L, 32L, 6L, 46L, 7L, 19L, 33L, 
48L, 21L, 35L, 9L, 36L, 10L, 49L, 22L, 14L, 28L, 41L, 2L, 32L, 
6L, 18L, 45L, 36L, 10L, 49L, 22L, 1L, 27L, 40L, 42L, 3L, 15L, 
29L, 19L, 7L, 46L, 33L, 48L, 21L, 9L, 35L, 6L, 18L, 32L, 45L, 
22L, 49L, 36L, 10L, 1L, 27L, 40L, 28L, 14L, 41L, 2L, 42L, 15L, 
29L, 3L, 45L, 18L, 32L, 6L, 21L, 9L, 48L, 35L, 10L, 22L, 36L, 
49L, 1L, 40L, 27L, 29L, 15L, 42L, 3L, 19L, 7L, 33L, 46L, 48L, 
35L, 9L, 21L, 27L, 1L, 40L, 14L, 2L, 41L, 28L, 15L, 29L, 3L, 
42L, 18L, 6L, 32L, 45L, 46L, 7L, 19L, 33L, 9L, 35L, 21L, 48L, 
22L, 10L, 36L, 49L, 27L, 1L, 40L, 27L, 40L, 1L, 14L, 28L, 41L, 
2L, 3L, 29L, 42L, 15L, 32L, 6L, 18L, 45L, 33L, 46L, 19L, 7L, 
9L, 21L, 48L, 35L, 22L, 10L, 49L, 36L, 40L, 1L, 27L, 41L, 2L, 
14L, 28L, 3L, 15L, 29L, 42L, 18L, 45L, 32L, 6L, 33L, 46L, 7L, 
19L, 9L, 35L, 48L, 21L, 22L, 49L, 10L, 36L, 2L, 28L, 14L, 41L, 
45L, 32L, 6L, 18L, 10L, 22L, 49L, 36L, 40L, 27L, 1L, 28L, 14L, 
2L, 41L, 15L, 3L, 42L, 29L, 45L, 6L, 32L, 18L, 19L, 33L, 7L, 
46L, 35L, 48L, 9L, 21L, 10L, 22L, 36L, 49L, 27L, 40L, 1L, 28L, 
2L, 41L, 14L, 3L, 29L, 15L, 42L, 31L, 5L, 44L, 17L, 45L, 32L, 
18L, 6L, 46L, 33L, 19L, 7L, 21L, 9L, 35L, 48L, 22L, 10L, 36L, 
49L, 40L, 27L, 1L, 42L, 15L, 29L, 3L, 18L, 40L, 1L, 27L, 2L, 
28L, 14L, 41L, 15L, 3L, 29L, 42L, 32L, 18L, 6L, 45L, 7L, 46L, 
19L, 33L, 48L, 9L, 35L, 21L, 22L, 10L, 36L, 49L, 1L, 40L, 27L, 
44L, 17L, 5L, 31L, 21L, 9L, 48L, 35L, 41L, 14L, 28L, 2L, 32L, 
6L, 18L, 45L, 49L, 22L, 10L, 36L, 40L, 1L, 27L, 2L, 28L, 41L, 
14L, 3L, 15L, 29L, 42L, 32L, 18L, 6L, 45L, 46L, 19L, 7L, 33L, 
21L, 48L, 9L, 35L, 36L, 22L, 49L, 10L, 1L, 27L, 40L, 41L, 2L, 
28L, 14L, 29L, 42L, 3L, 15L, 32L, 45L, 6L, 18L, 33L, 46L, 19L, 
7L, 35L, 9L, 48L, 21L, 36L, 10L, 49L, 22L, 14L, 2L, 41L, 28L, 
45L, 6L, 18L, 32L, 49L, 10L, 22L, 36L, 1L, 27L, 40L, 48L, 35L, 
9L, 21L, 6L, 45L, 32L, 18L, 36L, 10L, 49L, 22L, 40L, 27L, 1L, 
41L, 2L, 14L, 28L, 29L, 42L, 3L, 15L, 32L, 6L, 45L, 18L, 19L, 
46L, 33L, 7L, 48L, 9L, 21L, 35L, 22L, 10L, 36L, 49L, 40L, 27L, 
1L, 41L, 14L, 2L, 28L, 29L, 42L, 15L, 3L, 5L, 31L, 44L, 17L, 
45L, 32L, 18L, 6L, 33L, 46L, 19L, 7L, 48L, 21L, 35L, 9L, 49L, 
10L, 36L, 22L, 27L, 1L, 40L, 28L, 41L, 2L, 14L, 29L, 15L, 3L, 
42L, 6L, 45L, 32L, 18L, 46L, 33L, 19L, 7L, 21L, 35L, 48L, 9L, 
22L, 36L, 10L, 49L, 18L, 32L, 6L, 45L, 49L, 10L, 22L, 36L, 27L, 
40L, 1L, 41L, 28L, 14L, 2L, 42L, 3L, 15L, 29L, 6L, 18L, 32L, 
45L, 9L, 48L, 21L, 35L, 10L, 36L, 22L, 49L, 1L, 40L, 27L, 41L, 
28L, 14L, 2L, 29L, 15L, 3L, 42L, 18L, 32L, 45L, 6L, 9L, 21L, 
48L, 35L, 10L, 22L, 49L, 36L, 1L, 27L, 40L, 2L, 14L, 41L, 28L, 
42L, 29L, 15L, 3L, 18L, 32L, 6L, 45L, 46L, 7L, 33L, 19L, 35L, 
21L, 9L, 48L, 10L, 49L, 22L, 36L, 6L, 32L, 18L, 45L, 10L, 22L, 
36L, 49L, 40L, 1L, 27L, 41L, 14L, 28L, 2L, 29L, 3L, 15L, 42L, 
18L, 32L, 6L, 45L, 46L, 7L, 19L, 33L, 48L, 9L, 21L, 35L, 36L, 
49L, 22L, 10L, 6L, 32L, 18L, 45L, 49L, 22L, 10L, 36L, 27L, 1L, 
40L, 2L, 14L, 41L, 28L, 15L, 29L, 3L, 42L, 18L, 45L, 6L, 32L, 
9L, 21L, 35L, 48L, 10L, 36L, 49L, 22L, 40L, 1L, 27L, 14L, 41L, 
28L, 2L, 3L, 15L, 42L, 29L, 18L, 32L, 6L, 45L, 48L, 35L, 9L, 
21L, 10L, 49L, 36L, 22L, 45L, 32L, 6L, 18L, 36L, 22L, 49L, 10L, 
18L, 6L, 45L, 32L, 10L, 36L, 49L, 22L, 1L, 40L, 27L, 2L, 14L, 
28L, 41L, 42L, 3L, 15L, 29L, 32L, 6L, 45L, 18L, 33L, 46L, 7L, 
19L, 48L, 9L, 21L, 35L, 22L, 49L, 36L, 10L, 32L, 45L, 6L, 18L, 
22L, 36L, 10L, 49L, 41L, 28L, 14L, 2L, 6L, 18L, 32L, 45L, 49L, 
22L, 10L, 36L, 1L, 27L, 40L, 2L, 14L, 41L, 28L, 15L, 29L, 42L, 
3L, 6L, 45L, 32L, 18L, 19L, 7L, 46L, 33L, 21L, 9L, 35L, 48L, 
36L, 49L, 10L, 22L, 1L, 27L, 40L, 30L, 43L, 4L, 40L, 1L, 27L, 
41L, 2L, 28L, 14L, 3L, 42L, 29L, 15L, 44L, 31L, 17L, 5L, 6L, 
32L, 18L, 45L, 33L, 46L, 19L, 7L, 21L, 9L, 35L, 48L, 10L, 22L, 
49L, 36L, 27L, 1L, 40L, 14L, 2L, 28L, 41L, 29L, 42L, 3L, 15L, 
45L, 18L, 6L, 32L, 33L, 19L, 46L, 7L, 21L, 35L, 9L, 48L, 10L, 
36L, 49L, 22L, 40L, 1L, 27L, 18L, 45L, 32L, 6L, 22L, 36L, 10L, 
49L, 40L, 1L, 27L, 2L, 14L, 28L, 41L, 3L, 15L, 29L, 42L, 6L, 
32L, 45L, 18L, 46L, 33L, 7L, 19L, 48L, 35L, 21L, 9L, 22L, 36L, 
10L, 49L, 28L, 14L, 2L, 41L, 32L, 18L, 6L, 45L, 49L, 10L, 22L, 
36L, 2L, 28L, 41L, 14L, 32L, 6L, 45L, 18L, 10L, 49L, 36L, 22L, 
45L, 32L, 18L, 6L, 10L, 22L, 49L, 36L, 6L, 32L, 18L, 45L, 36L, 
10L, 22L, 49L, 18L, 6L, 45L, 32L, 10L, 36L, 22L, 49L, 40L, 1L, 
27L, 28L, 2L, 14L, 41L, 3L, 29L, 15L, 42L, 45L, 32L, 6L, 18L, 
35L, 21L, 48L, 9L, 22L, 49L, 10L, 36L, 14L, 41L, 2L, 28L, 18L, 
45L, 6L, 32L, 10L, 49L, 36L, 22L, 18L, 32L, 45L, 6L, 22L, 36L, 
49L, 10L, 14L, 41L, 28L, 2L, 32L, 6L, 45L, 18L, 49L, 36L, 10L, 
22L, 41L, 2L, 14L, 28L, 6L, 45L, 18L, 32L, 10L, 22L, 49L, 36L, 
6L, 32L, 45L, 18L, 49L, 22L, 36L, 10L, 41L, 28L, 14L, 2L, 6L, 
45L, 18L, 32L, 22L, 10L, 49L, 36L, 1L, 27L, 40L, 28L, 2L, 14L, 
41L, 42L, 29L, 15L, 3L, 45L, 6L, 18L, 32L, 9L, 21L, 35L, 48L, 
10L, 36L, 49L, 22L, 27L, 1L, 40L, 14L, 28L, 41L, 2L, 15L, 29L, 
42L, 3L, 18L, 45L, 32L, 6L, 46L, 19L, 7L, 33L, 9L, 35L, 21L, 
48L, 49L, 36L, 22L, 10L, 1L, 40L, 27L, 28L, 14L, 2L, 41L, 15L, 
42L, 29L, 3L, 32L, 6L, 18L, 45L, 7L, 33L, 19L, 46L, 48L, 35L, 
21L, 9L, 10L, 36L, 49L, 22L, 27L, 1L, 40L, 48L, 9L, 35L, 21L, 
14L, 41L, 2L, 28L, 45L, 18L, 6L, 32L, 49L, 10L, 36L, 22L, 1L, 
40L, 27L, 2L, 28L, 14L, 41L, 15L, 3L, 42L, 29L, 18L, 6L, 45L, 
32L, 33L, 19L, 7L, 46L, 9L, 48L, 21L, 35L, 10L, 49L, 22L, 36L, 
2L, 41L, 14L, 28L, 45L, 32L, 18L, 6L, 49L, 10L, 22L, 36L, 1L, 
40L, 27L, 41L, 14L, 28L, 2L, 15L, 29L, 42L, 3L, 17L, 31L, 44L, 
5L, 18L, 32L, 45L, 6L, 33L, 7L, 46L, 19L, 9L, 35L, 48L, 21L, 
36L, 10L, 22L, 49L, 2L, 14L, 41L, 28L, 45L, 6L, 32L, 18L, 36L, 
22L, 10L, 49L, 41L, 14L, 28L, 2L, 18L, 45L, 32L, 6L, 49L, 22L, 
36L, 10L, 40L, 27L, 1L, 41L, 2L, 14L, 28L, 42L, 29L, 3L, 15L, 
32L, 45L, 18L, 6L, 46L, 19L, 33L, 7L, 9L, 48L, 21L, 35L, 10L, 
49L, 36L, 22L, 1L, 40L, 27L, 41L, 28L, 14L, 2L, 3L, 29L, 15L, 
42L, 6L, 18L, 32L, 45L, 46L, 7L, 33L, 19L, 9L, 48L, 21L, 35L, 
36L, 10L, 49L, 22L, 14L, 28L, 2L, 41L, 45L, 18L, 32L, 6L, 10L, 
22L, 36L, 49L, 1L, 27L, 40L, 14L, 2L, 41L, 28L, 29L, 15L, 3L, 
42L, 18L, 45L, 32L, 6L, 22L, 10L, 49L, 36L, 27L, 40L, 1L, 14L, 
28L, 41L, 2L, 29L, 15L, 42L, 3L, 32L, 45L, 6L, 18L, 7L, 46L, 
19L, 33L, 21L, 9L, 48L, 35L, 49L, 36L, 22L, 10L, 27L, 1L, 40L, 
28L, 41L, 14L, 2L, 15L, 3L, 29L, 42L, 18L, 32L, 6L, 45L, 46L, 
19L, 33L, 7L, 21L, 48L, 35L, 9L, 49L, 36L, 22L, 10L, 28L, 2L, 
14L, 41L, 32L, 18L, 45L, 6L, 22L, 10L, 49L, 36L, 40L, 1L, 27L, 
28L, 14L, 41L, 2L, 15L, 42L, 3L, 29L, 6L, 45L, 18L, 32L, 48L, 
21L, 9L, 35L, 22L, 36L, 49L, 10L, 14L, 41L, 28L, 2L, 45L, 6L, 
18L, 32L, 36L, 22L, 10L, 49L, 40L, 27L, 1L, 5L, 44L, 17L, 31L, 
35L, 9L, 21L, 48L, 27L, 1L, 40L, 14L, 2L, 28L, 41L, 15L, 29L, 
3L, 42L, 45L, 6L, 32L, 18L, 36L, 10L, 22L, 49L, 28L, 2L, 14L, 
41L, 15L, 29L, 42L, 3L, 18L, 45L, 32L, 6L, 46L, 7L, 33L, 19L, 
9L, 48L, 21L, 35L, 49L, 36L, 10L, 22L, 1L, 40L, 27L, 14L, 28L, 
2L, 41L, 42L, 3L, 15L, 29L, 18L, 32L, 45L, 6L, 9L, 21L, 48L, 
35L, 36L, 49L, 22L, 10L, 1L, 40L, 27L, 41L, 2L, 28L, 14L, 3L, 
42L, 15L, 29L, 45L, 6L, 18L, 32L, 48L, 9L, 21L, 35L, 36L, 22L, 
10L, 49L, 40L, 1L, 27L, 14L, 41L, 2L, 28L, 15L, 42L, 3L, 29L, 
6L, 32L, 45L, 18L, 33L, 19L, 7L, 46L, 35L, 48L, 9L, 21L, 36L, 
22L, 49L, 10L, 6L, 18L, 45L, 32L, 22L, 10L, 49L, 36L, 6L, 18L, 
32L, 45L, 36L, 10L, 22L, 49L, 2L, 14L, 28L, 41L, 45L, 18L, 32L, 
6L, 22L, 49L, 10L, 36L, 2L, 28L, 14L, 41L, 32L, 6L, 18L, 45L, 
10L, 36L, 49L, 22L, 14L, 28L, 2L, 41L, 18L, 32L, 6L, 45L, 22L, 
49L, 36L, 10L, 28L, 41L, 14L, 2L, 18L, 6L, 45L, 32L, 10L, 22L, 
49L, 36L, 41L, 14L, 2L, 28L, 18L, 32L, 45L, 6L, 36L, 49L, 10L, 
22L, 1L, 27L, 40L, 41L, 28L, 14L, 2L, 3L, 29L, 42L, 15L, 32L, 
6L, 45L, 18L, 46L, 7L, 33L, 19L, 21L, 48L, 35L, 9L, 10L, 22L, 
49L, 36L, 1L, 27L, 40L, 28L, 41L, 14L, 2L, 15L, 29L, 3L, 42L, 
6L, 18L, 45L, 32L, 33L, 7L, 19L, 46L, 9L, 35L, 21L, 48L, 10L, 
22L, 36L, 49L, 41L, 2L, 14L, 28L, 32L, 6L, 45L, 18L, 22L, 49L, 
10L, 36L, 2L, 14L, 28L, 41L, 32L, 18L, 6L, 45L, 22L, 49L, 36L, 
10L, 18L, 6L, 45L, 32L, 22L, 10L, 36L, 49L, 40L, 1L, 27L, 48L, 
21L, 9L, 35L, 27L, 40L, 1L, 28L, 14L, 2L, 41L, 42L, 15L, 29L, 
3L, 32L, 45L, 18L, 6L, 21L, 35L, 9L, 48L, 36L, 10L, 22L, 49L, 
40L, 1L, 27L, 41L, 28L, 14L, 2L, 42L, 29L, 3L, 15L, 45L, 6L, 
32L, 18L, 46L, 7L, 19L, 33L, 48L, 35L, 21L, 9L, 49L, 22L, 10L, 
36L, 41L, 2L, 14L, 28L, 6L, 18L, 45L, 32L, 10L, 49L, 22L, 36L, 
2L, 28L, 41L, 14L, 32L, 6L, 45L, 18L, 10L, 22L, 49L, 36L, 40L, 
1L, 27L, 2L, 41L, 14L, 28L, 3L, 29L, 42L, 15L, 45L, 32L, 18L, 
6L, 9L, 35L, 21L, 48L, 22L, 10L, 36L, 49L, 1L, 40L, 27L, 28L, 
41L, 14L, 2L, 3L, 29L, 15L, 42L, 45L, 32L, 6L, 18L, 35L, 21L, 
9L, 48L, 10L, 49L, 22L, 36L, 27L, 1L, 40L, 35L, 9L, 48L, 21L, 
27L, 1L, 40L, 9L, 48L, 21L, 35L, 40L, 1L, 27L, 2L, 14L, 28L, 
41L, 3L, 42L, 29L, 15L, 18L, 32L, 6L, 45L, 21L, 35L, 9L, 48L, 
36L, 22L, 10L, 49L, 14L, 28L, 41L, 2L, 5L, 31L, 17L, 44L, 32L, 
45L, 6L, 18L, 22L, 49L, 36L, 10L, 1L, 27L, 40L, 2L, 14L, 28L, 
41L, 42L, 29L, 3L, 15L, 45L, 32L, 18L, 6L, 33L, 19L, 46L, 7L, 
21L, 35L, 9L, 48L, 10L, 22L, 36L, 49L, 40L, 1L, 27L, 28L, 41L, 
2L, 14L, 29L, 3L, 42L, 15L, 32L, 18L, 6L, 45L, 22L, 10L, 49L, 
36L, 41L, 28L, 14L, 2L, 45L, 6L, 32L, 18L, 36L, 49L, 10L, 22L, 
18L, 45L, 6L, 32L, 36L, 22L, 49L, 10L, 45L, 32L, 6L, 18L, 36L, 
10L, 49L, 22L, 1L, 40L, 27L, 14L, 28L, 41L, 2L, 15L, 42L, 3L, 
29L, 18L, 32L, 6L, 45L, 7L, 46L, 33L, 19L, 9L, 21L, 48L, 35L, 
49L, 22L, 36L, 10L, 41L, 14L, 28L, 2L, 32L, 45L, 6L, 18L, 49L, 
36L, 22L, 10L, 6L, 32L, 45L, 18L, 10L, 22L, 49L, 36L, 18L, 27L, 
1L, 40L, 41L, 28L, 2L, 14L, 42L, 29L, 3L, 15L, 45L, 6L, 18L, 
32L, 33L, 46L, 7L, 19L, 48L, 9L, 21L, 35L, 10L, 22L, 36L, 49L, 
40L, 27L, 1L, 15L, 3L, 42L, 29L, 6L, 32L, 18L, 45L, 10L, 36L, 
22L, 49L, 1L, 27L, 40L, 28L, 41L, 2L, 14L, 3L, 15L, 29L, 42L, 
6L, 18L, 32L, 45L, 35L, 9L, 48L, 21L, 10L, 22L, 36L, 49L, 32L, 
45L, 6L, 18L, 36L, 10L, 22L, 49L, 27L, 40L, 1L, 9L, 21L, 35L, 
48L, 27L, 1L, 40L, 29L, 42L, 3L, 15L, 18L, 27L, 1L, 40L, 14L, 
2L, 28L, 41L, 42L, 15L, 3L, 29L, 6L, 18L, 32L, 45L, 48L, 35L, 
9L, 21L, 49L, 22L, 36L, 10L, 43L, 4L, 30L, 40L, 27L, 1L, 2L, 
28L, 41L, 14L, 29L, 42L, 3L, 15L, 45L, 32L, 18L, 6L, 33L, 7L, 
46L, 19L, 35L, 48L, 9L, 21L, 36L, 22L, 49L, 10L, 14L, 28L, 41L, 
2L, 18L, 45L, 32L, 6L, 49L, 22L, 10L, 36L, 40L, 27L, 1L, 41L, 
2L, 14L, 28L, 29L, 15L, 42L, 3L, 6L, 45L, 32L, 18L, 48L, 9L, 
21L, 35L, 36L, 49L, 22L, 10L, 27L, 40L, 1L, 14L, 28L, 41L, 2L, 
29L, 15L, 3L, 42L, 32L, 6L, 45L, 18L, 21L, 9L, 48L, 35L, 10L, 
36L, 49L, 22L, 1L, 27L, 40L, 28L, 14L, 2L, 41L, 42L, 3L, 29L, 
15L, 45L, 18L, 32L, 6L, 33L, 7L, 46L, 19L, 35L, 9L, 48L, 21L, 
36L, 10L, 22L, 49L, 40L, 1L, 27L, 14L, 41L, 28L, 2L, 15L, 29L, 
3L, 42L, 32L, 45L, 18L, 6L, 9L, 48L, 35L, 21L, 10L, 36L, 49L, 
22L, 40L, 1L, 27L, 28L, 2L, 14L, 41L, 42L, 15L, 3L, 29L, 45L, 
6L, 18L, 32L, 33L, 19L, 46L, 7L, 35L, 21L, 9L, 48L, 49L, 22L, 
36L, 10L, 40L, 27L, 1L, 28L, 41L, 2L, 14L, 29L, 42L, 3L, 15L, 
6L, 45L, 32L, 18L, 33L, 19L, 7L, 46L, 48L, 9L, 21L, 35L, 36L, 
49L, 10L, 22L, 14L, 41L, 28L, 2L, 45L, 18L, 32L, 6L, 10L, 22L, 
36L, 49L, 32L, 45L, 6L, 18L, 10L, 49L, 36L, 22L, 28L, 2L, 14L, 
41L, 6L, 32L, 45L, 18L, 10L, 36L, 22L, 49L, 27L, 1L, 40L, 41L, 
2L, 28L, 14L, 15L, 42L, 3L, 29L, 32L, 6L, 45L, 18L, 19L, 7L, 
33L, 46L, 35L, 21L, 9L, 48L, 36L, 49L, 22L, 10L, 28L, 14L, 2L, 
41L, 32L, 6L, 18L, 45L, 36L, 49L, 10L, 22L), .Label = c("Apr 06 - Jun 06", 
"Apr 07 - Jun 07", "Apr 08 - Jun 08", "Apr 09 - Jun 09", "Apr 10 - Jun 10", 
"Apr 11 - Jun 11", "Apr 12 - Jun 12", "Apr 13 - Jun 13", "Apr 14 - Jun 14", 
"Apr 15 - Jun 15", "Apr 16 - Jun 16", "Apr 17 - Jun 17", "Apr 18 - Jun 18", 
"Jan 07 - Mar 07", "Jan 08 - Mar 08", "Jan 09 - Mar 09", "Jan 10 - Mar 10", 
"Jan 11 - Mar 11", "Jan 12 - Mar 12", "Jan 13 - Mar 13", "Jan 14 - Mar 14", 
"Jan 15 - Mar 15", "Jan 16 - Mar 16", "Jan 17 - Mar 17", "Jan 18 - Mar 18", 
"Jan 19 - Mar 19", "Jul 06 - Sep 06", "Jul 07 - Sep 07", "Jul 08 - Sep 08", 
"Jul 09 - Sep 09", "Jul 10 - Sep 10", "Jul 11 - Sep 11", "Jul 12 - Sep 12", 
"Jul 13 - Sep 13", "Jul 14 - Sep 14", "Jul 15 - Sep 15", "Jul 16 - Sep 16", 
"Jul 17 - Sep 17", "Jul 18 - Sep 18", "Oct 06 - Dec 06", "Oct 07 - Dec 07", 
"Oct 08 - Dec 08", "Oct 09 - Dec 09", "Oct 10 - Dec 10", "Oct 11 - Dec 11", 
"Oct 12 - Dec 12", "Oct 13 - Dec 13", "Oct 14 - Dec 14", "Oct 15 - Dec 15", 
"Oct 16 - Dec 16", "Oct 17 - Dec 17", "Oct 18 - Dec 18"), class = "factor")

Есть ли способ превратить это в объект данных с помощью lubridate? Я пробовал разные вещи вроде этого:

a <-  as.numeric(df$Period)
library(lubridate)
a <- quarter(a, with_year = TRUE)

И много подобных вариантов этого, но я не могу понять, как это сделать.

Спасибо!

1 Ответ

4 голосов
/ 16 июня 2020

Предполагая, что ввод такой, как показано ниже, мы можем разделить его на от и до.

Затем преобразовать в класс yearmon, который представляет год / месяц как год + дробь, где дробь = 0 для января, 1/12 для Feb, ..., 11/12 для De c (например, добавление 1/12 к такому объекту увеличивает его на один месяц) и отображается, как показано.

Мы также конвертируем в класс yearqtr, который представляет кварталы как год + дробь, где дробь равна 0, 1/4, 1/2 и 3/4 для последовательных кварталов, например, добавляя 1/4 к таким объект увеличивает его на четверть.

Эти объекты отображаются, как показано ниже.

Обратите внимание, что в вопросе указано, что Period является символом, но вывод dput показывает, что он имеет класс фактора, а не символ.

library(dplyr)
library(tidyr)
library(zoo)

df <- data.frame(Period = c("Jul 06 - Sep 06", "Oct 06 - Dec 06", 
  "Apr 06 - Jun 06", "Apr 08 - Jun 08"))

df %>%
 separate(Period, c("from", "to"), sep = " - ") %>%
 mutate(from = as.yearmon(from, "%b %y"),
        to = as.yearmon(to, "%b %y"),
        year_qtr = as.yearqtr(to),
        year = as.integer(to),
        qtr = cycle(year_qtr),
        from_date = as.Date(from),
        to_date = as.Date(to, frac = 1))

подача:

      from       to year_qtr year qtr  from_date    to_date
1 Jul 2006 Sep 2006  2006 Q3 2006   3 2006-07-01 2006-09-30
2 Oct 2006 Dec 2006  2006 Q4 2006   4 2006-10-01 2006-12-31
3 Apr 2006 Jun 2006  2006 Q2 2006   2 2006-04-01 2006-06-30
4 Apr 2008 Jun 2008  2008 Q2 2008   2 2008-04-01 2008-06-30
...