Related
I've been trying to find a way to convert text files with pixels values into images (no matter the format) in R but I couldn't find a way to do it.
I found solutions for MatLab and Python, for example.
I have a file with 520 x 640 pixels with values from 0 to 255.
This is a small piece of it.
mid1al <- read.table("C:/Users/u015/Mid1_R_Al.txt", header = FALSE, sep = ";")
mid1al <- mid1al[1:20,1:20]
dput(mid1al)
structure(list(V1 = c(84L, 79L, 97L, 67L, 98L, 113L, 77L, 46L,
41L, 37L, 42L, 46L, 23L, 28L, 24L, 34L, 45L, 51L, 24L, 24L),
V2 = c(118L, 107L, 105L, 82L, 87L, 108L, 100L, 40L, 71L,
74L, 81L, 55L, 41L, 25L, 22L, 58L, 53L, 38L, 26L, 36L), V3 = c(103L,
116L, 128L, 82L, 77L, 104L, 97L, 50L, 65L, 78L, 98L, 111L,
86L, 59L, 35L, 51L, 43L, 46L, 33L, 47L), V4 = c(114L, 91L,
90L, 96L, 103L, 98L, 86L, 36L, 50L, 65L, 98L, 125L, 86L,
32L, 24L, 36L, 36L, 44L, 34L, 43L), V5 = c(68L, 70L, 85L,
85L, 100L, 111L, 61L, 12L, 42L, 70L, 103L, 103L, 45L, 27L,
18L, 27L, 32L, 43L, 51L, 41L), V6 = c(43L, 87L, 85L, 89L,
130L, 123L, 78L, 43L, 15L, 39L, 62L, 44L, 27L, 14L, 19L,
61L, 83L, 90L, 88L, 88L), V7 = c(20L, 72L, 116L, 124L, 133L,
133L, 103L, 56L, 21L, 9L, 19L, 26L, 18L, 32L, 67L, 92L, 100L,
105L, 94L, 79L), V8 = c(69L, 96L, 120L, 144L, 142L, 101L,
96L, 46L, 14L, 4L, 8L, 2L, 24L, 73L, 96L, 106L, 103L, 116L,
109L, 74L), V9 = c(118L, 122L, 134L, 135L, 133L, 98L, 57L,
20L, 5L, 5L, 2L, 14L, 51L, 89L, 117L, 95L, 103L, 93L, 104L,
77L), V10 = c(122L, 107L, 127L, 147L, 128L, 88L, 24L, 11L,
10L, 4L, 10L, 31L, 74L, 104L, 113L, 107L, 109L, 99L, 103L,
45L), V11 = c(105L, 120L, 114L, 132L, 125L, 112L, 51L, 6L,
3L, 9L, 18L, 49L, 82L, 111L, 111L, 96L, 92L, 81L, 75L, 18L
), V12 = c(98L, 104L, 103L, 126L, 147L, 128L, 61L, 26L, 2L,
9L, 18L, 50L, 105L, 103L, 101L, 98L, 74L, 53L, 18L, 1L),
V13 = c(107L, 91L, 108L, 109L, 138L, 114L, 88L, 33L, 2L,
4L, 9L, 61L, 71L, 77L, 78L, 83L, 43L, 38L, 8L, 5L), V14 = c(53L,
60L, 43L, 49L, 104L, 128L, 72L, 44L, 6L, 8L, 10L, 24L, 35L,
27L, 33L, 37L, 31L, 24L, 10L, 5L), V15 = c(13L, 16L, 11L,
27L, 62L, 78L, 73L, 30L, 8L, 7L, 31L, 66L, 66L, 33L, 13L,
27L, 16L, 18L, 12L, 7L), V16 = c(11L, 12L, 7L, 3L, 16L, 35L,
45L, 13L, 5L, 7L, 22L, 74L, 73L, 31L, 16L, 43L, 35L, 14L,
15L, 8L), V17 = c(15L, 16L, 7L, 8L, 1L, 5L, 15L, 13L, 31L,
33L, 22L, 34L, 38L, 17L, 18L, 41L, 39L, 26L, 19L, 12L), V18 = c(9L,
15L, 7L, 2L, 2L, 5L, 5L, 25L, 50L, 55L, 35L, 25L, 14L, 8L,
18L, 44L, 36L, 36L, 19L, 0L), V19 = c(15L, 16L, 4L, 6L, 4L,
6L, 22L, 45L, 59L, 48L, 56L, 58L, 52L, 30L, 22L, 46L, 41L,
50L, 23L, 7L), V20 = c(20L, 7L, 4L, 2L, 6L, 14L, 40L, 55L,
74L, 60L, 69L, 74L, 60L, 56L, 38L, 45L, 67L, 39L, 25L, 11L
)), row.names = c(NA, 20L), class = "data.frame")
Is there a way to create this image in Rstudio?
I want to test correlation for 9 different columns using kendall and extract p-value
for correlation between v9 and 7 other columns (v2 until v8).
Date v1 v2 v3 v4 v5 v6 v7 v8
1 2014-01-05 39 4 84 75 41 6 83 610
2 2014-01-12 40 6 86 77 44 6 84 765
3 2014-01-19 39 5 82 73 40 6 81 713
4 2014-01-26 37 5 100 71 39 6 90 685
5 2014-02-02 39 5 83 70 37 5 79 601
6 2014-02-09 44 6 82 78 40 6 78 535
AllData <- structure(list(Date = structure(c(16075, 16082, 16089, 16096,
16103, 16110, 16117, 16124, 16131, 16138, 16145, 16152, 16159,
16166, 16173, 16180, 16187, 16194, 16201, 16208, 16215, 16222,
16229, 16236, 16243, 16250, 16257, 16264, 16271, 16278, 16285,
16292, 16299, 16306, 16313, 16320, 16327, 16334, 16341, 16348,
16355, 16362, 16369, 16376, 16383, 16390, 16397, 16404, 16411,
16418, 16425, 16432, 16439, 16446, 16453, 16460, 16467, 16474,
16481, 16488, 16495, 16502, 16509, 16516, 16523, 16530, 16537,
16544, 16551, 16558, 16565, 16572, 16579, 16586, 16593, 16600,
16607, 16614, 16621, 16628, 16635, 16642, 16649, 16656, 16663,
16670, 16677, 16684, 16691, 16698, 16705, 16712, 16719, 16726,
16733, 16740, 16747, 16754, 16761, 16768, 16775, 16782, 16789,
16796, 16803, 16810, 16817, 16824, 16831, 16838, 16845, 16852,
16859, 16866, 16873, 16880, 16887, 16894, 16901, 16908, 16915,
16922, 16929, 16936, 16943, 16950, 16957, 16964, 16971, 16978,
16985, 16992, 16999, 17006, 17013, 17020, 17027, 17034, 17041,
17048, 17055, 17062, 17069, 17076, 17083, 17090, 17097, 17104,
17111, 17118, 17125, 17132, 17139, 17146, 17153, 17160, 17167,
17174, 17181, 17188, 17195, 17202, 17209, 17216, 17223, 17230,
17237, 17244, 17251, 17258, 17265, 17272, 17279, 17286, 17293,
17300, 17307, 17314, 17321, 17328, 17335, 17342, 17349, 17356,
17363, 17370, 17377, 17384, 17391, 17398, 17405, 17412, 17419,
17426, 17433, 17440, 17447, 17454, 17461, 17468, 17475, 17482,
17489, 17496, 17503, 17510, 17517, 17524, 17531, 17538, 17545,
17552, 17559, 17566, 17573, 17580, 17587, 17594, 17601, 17608,
17615, 17622, 17629, 17636, 17643, 17650, 17657, 17664, 17671,
17678, 17685, 17692, 17699, 17706, 17713, 17720, 17727, 17734,
17741, 17748, 17755, 17762, 17769, 17776, 17783, 17790, 17797,
17804, 17811, 17818, 17825, 17832, 17839, 17846, 17853, 17860,
17867, 17874, 17881, 17888, 17895, 17902, 17909, 17916, 17923,
17930, 17937, 17944, 17951, 17958, 17965, 17972, 17979, 17986,
17993, 18000, 18007, 18014, 18021, 18028, 18035, 18042, 18049,
18056, 18063, 18070, 18077, 18084, 18091, 18098, 18105, 18112,
18119, 18126, 18133, 18140, 18147, 18154, 18161, 18168, 18175,
18182, 18189, 18196, 18203, 18210, 18217, 18224, 18231, 18238,
18245, 18252, 18259, 18266, 18273, 18280, 18287, 18294, 18301,
18308, 18315), class = "Date"), v1 = c(39L, 40L, 39L, 37L,
39L, 44L, 41L, 40L, 35L, 39L, 35L, 32L, 36L, 34L, 32L, 34L, 32L,
34L, 32L, 30L, 36L, 34L, 35L, 32L, 35L, 32L, 33L, 35L, 35L, 35L,
35L, 36L, 41L, 36L, 34L, 32L, 33L, 30L, 33L, 36L, 34L, 39L, 36L,
34L, 35L, 40L, 46L, 40L, 41L, 44L, 48L, 45L, 32L, 28L, 31L, 29L,
32L, 31L, 33L, 33L, 33L, 31L, 28L, 30L, 29L, 25L, 25L, 25L, 26L,
26L, 24L, 24L, 26L, 25L, 28L, 32L, 32L, 32L, 32L, 35L, 36L, 32L,
31L, 32L, 32L, 35L, 36L, 33L, 30L, 32L, 37L, 42L, 36L, 36L, 33L,
33L, 31L, 46L, 49L, 63L, 77L, 56L, 58L, 57L, 71L, 44L, 36L, 39L,
35L, 35L, 35L, 32L, 33L, 36L, 33L, 33L, 34L, 29L, 30L, 30L, 28L,
27L, 31L, 29L, 28L, 29L, 29L, 100L, 64L, 42L, 48L, 43L, 39L,
36L, 33L, 30L, 32L, 31L, 34L, 34L, 31L, 35L, 35L, 40L, 40L, 40L,
39L, 38L, 50L, 46L, 48L, 47L, 40L, 43L, 43L, 44L, 60L, 54L, 50L,
51L, 61L, 55L, 55L, 62L, 51L, 54L, 51L, 45L, 45L, 46L, 45L, 48L,
47L, 44L, 42L, 42L, 42L, 43L, 44L, 54L, 53L, 48L, 51L, 47L, 45L,
45L, 47L, 49L, 51L, 44L, 43L, 46L, 42L, 46L, 44L, 100L, 62L,
54L, 53L, 45L, 93L, 61L, 76L, 60L, 52L, 53L, 62L, 56L, 54L, 21L,
19L, 21L, 21L, 20L, 82L, 100L, 62L, 38L, 34L, 31L, 35L, 27L,
23L, 21L, 21L, 20L, 21L, 21L, 22L, 22L, 20L, 19L, 20L, 19L, 21L,
20L, 20L, 19L, 21L, 21L, 20L, 18L, 22L, 19L, 18L, 18L, 17L, 20L,
19L, 20L, 21L, 24L, 26L, 25L, 32L, 24L, 25L, 25L, 28L, 27L, 25L,
53L, 53L, 49L, 50L, 49L, 52L, 53L, 58L, 53L, 56L, 52L, 50L, 49L,
52L, 62L, 46L, 45L, 52L, 41L, 45L, 50L, 48L, 48L, 49L, 50L, 50L,
47L, 49L, 44L, 54L, 100L, 67L, 58L, 45L, 60L, 51L, 56L, 50L,
50L, 48L, 48L, 49L, 48L, 54L, 57L, 67L, 74L, 58L, 60L, 64L, 77L,
70L, 82L, 72L, 77L, 74L, 67L, 79L, 74L, 88L), v2 = c(4L,
6L, 5L, 5L, 5L, 6L, 5L, 5L, 4L, 4L, 5L, 5L, 6L, 6L, 6L, 5L, 5L,
5L, 5L, 4L, 5L, 5L, 4L, 6L, 5L, 4L, 5L, 5L, 6L, 4L, 4L, 4L, 5L,
5L, 5L, 5L, 4L, 5L, 6L, 5L, 6L, 6L, 4L, 6L, 6L, 6L, 6L, 5L, 6L,
4L, 7L, 6L, 5L, 5L, 7L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 4L, 5L, 4L,
4L, 6L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 4L, 4L, 4L, 5L, 4L,
4L, 4L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 6L,
5L, 7L, 7L, 5L, 7L, 9L, 7L, 6L, 6L, 5L, 5L, 5L, 4L, 6L, 5L, 6L,
4L, 5L, 5L, 5L, 4L, 4L, 5L, 4L, 5L, 4L, 4L, 4L, 5L, 3L, 5L, 4L,
5L, 4L, 5L, 4L, 4L, 5L, 4L, 5L, 4L, 5L, 4L, 4L, 4L, 4L, 5L, 5L,
5L, 5L, 5L, 4L, 4L, 7L, 6L, 5L, 4L, 5L, 7L, 8L, 8L, 8L, 8L, 7L,
7L, 8L, 8L, 8L, 8L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 5L, 7L, 8L, 6L,
6L, 6L, 6L, 6L, 6L, 8L, 7L, 7L, 8L, 7L, 8L, 8L, 6L, 7L, 6L, 6L,
8L, 7L, 7L, 7L, 6L, 7L, 8L, 8L, 8L, 10L, 8L, 5L, 7L, 7L, 9L,
8L, 3L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 3L, 4L, 3L, 3L, 3L,
3L, 3L, 3L, 2L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 4L, 2L, 3L, 3L, 2L, 3L, 4L, 4L, 4L, 4L, 3L,
3L, 4L, 4L, 5L, 4L, 8L, 7L, 8L, 7L, 5L, 7L, 8L, 8L, 7L, 7L, 7L,
9L, 6L, 9L, 8L, 6L, 6L, 8L, 7L, 7L, 8L, 7L, 7L, 7L, 8L, 7L, 7L,
6L, 7L, 7L, 8L, 6L, 7L, 6L, 8L, 6L, 5L, 9L, 6L, 8L, 7L, 6L, 6L,
7L, 6L, 7L, 8L, 8L, 8L, 7L, 10L, 10L, 10L, 11L, 11L, 10L, 9L,
10L, 10L, 9L), v3 = c(84L, 86L, 82L, 100L, 83L, 82L,
76L, 74L, 81L, 72L, 67L, 66L, 67L, 64L, 67L, 61L, 67L, 63L, 59L,
60L, 57L, 54L, 60L, 59L, 53L, 61L, 61L, 57L, 59L, 63L, 60L, 56L,
60L, 64L, 57L, 55L, 58L, 61L, 56L, 63L, 65L, 63L, 59L, 64L, 60L,
62L, 70L, 65L, 65L, 61L, 71L, 69L, 54L, 59L, 54L, 55L, 55L, 56L,
74L, 100L, 86L, 69L, 54L, 55L, 48L, 47L, 48L, 48L, 46L, 44L,
42L, 45L, 43L, 48L, 46L, 43L, 45L, 44L, 52L, 47L, 50L, 49L, 47L,
47L, 50L, 49L, 51L, 47L, 45L, 45L, 49L, 53L, 55L, 56L, 52L, 52L,
51L, 64L, 67L, 73L, 78L, 65L, 76L, 74L, 62L, 57L, 52L, 75L, 54L,
47L, 52L, 52L, 49L, 42L, 45L, 43L, 45L, 42L, 44L, 41L, 40L, 38L,
39L, 41L, 42L, 43L, 39L, 60L, 50L, 49L, 52L, 51L, 46L, 47L, 42L,
44L, 45L, 44L, 47L, 44L, 49L, 43L, 50L, 47L, 48L, 52L, 53L, 51L,
64L, 57L, 60L, 52L, 45L, 48L, 49L, 56L, 81L, 71L, 61L, 68L, 69L,
67L, 69L, 61L, 68L, 69L, 63L, 63L, 61L, 59L, 78L, 60L, 56L, 57L,
57L, 54L, 52L, 48L, 53L, 49L, 50L, 53L, 58L, 55L, 61L, 52L, 57L,
55L, 57L, 51L, 51L, 52L, 54L, 58L, 58L, 80L, 67L, 62L, 60L, 60L,
65L, 64L, 78L, 70L, 63L, 68L, 67L, 75L, 66L, 27L, 26L, 26L, 27L,
24L, 30L, 35L, 33L, 31L, 28L, 28L, 30L, 28L, 26L, 23L, 22L, 21L,
22L, 21L, 20L, 22L, 20L, 20L, 21L, 20L, 24L, 21L, 21L, 22L, 23L,
22L, 24L, 25L, 20L, 22L, 23L, 22L, 20L, 21L, 22L, 22L, 23L, 25L,
25L, 25L, 33L, 28L, 25L, 28L, 27L, 29L, 30L, 58L, 57L, 60L, 58L,
56L, 60L, 59L, 57L, 56L, 60L, 55L, 55L, 54L, 50L, 53L, 55L, 48L,
50L, 53L, 47L, 46L, 51L, 52L, 55L, 61L, 60L, 51L, 51L, 57L, 53L,
71L, 67L, 58L, 56L, 93L, 71L, 66L, 68L, 60L, 62L, 61L, 56L, 57L,
61L, 64L, 64L, 75L, 65L, 64L, 69L, 78L, 84L, 100L, 91L, 94L,
86L, 83L, 89L, 89L, 87L), v4 = c(75L, 77L, 73L, 71L, 70L,
78L, 76L, 72L, 71L, 72L, 75L, 75L, 70L, 74L, 72L, 74L, 74L, 73L,
69L, 74L, 72L, 71L, 74L, 72L, 72L, 82L, 74L, 83L, 78L, 73L, 73L,
80L, 88L, 88L, 74L, 68L, 70L, 76L, 72L, 76L, 75L, 76L, 71L, 77L,
96L, 85L, 100L, 90L, 81L, 80L, 87L, 86L, 81L, 77L, 81L, 74L,
73L, 74L, 76L, 71L, 84L, 79L, 74L, 74L, 72L, 80L, 72L, 73L, 70L,
69L, 69L, 77L, 72L, 77L, 72L, 77L, 77L, 85L, 77L, 74L, 77L, 77L,
76L, 77L, 75L, 77L, 79L, 73L, 71L, 73L, 78L, 78L, 76L, 74L, 74L,
75L, 81L, 86L, 95L, 91L, 85L, 83L, 90L, 92L, 72L, 67L, 72L, 77L,
68L, 64L, 68L, 73L, 75L, 71L, 71L, 70L, 69L, 72L, 68L, 67L, 65L,
65L, 63L, 64L, 64L, 67L, 64L, 80L, 73L, 70L, 100L, 73L, 78L,
62L, 63L, 66L, 60L, 61L, 61L, 62L, 61L, 73L, 71L, 70L, 69L, 67L,
67L, 68L, 64L, 73L, 75L, 70L, 67L, 64L, 68L, 76L, 71L, 73L, 75L,
71L, 74L, 68L, 68L, 72L, 71L, 70L, 69L, 69L, 69L, 71L, 73L, 73L,
68L, 71L, 68L, 64L, 65L, 73L, 66L, 67L, 69L, 72L, 80L, 66L, 69L,
68L, 66L, 72L, 67L, 75L, 75L, 69L, 70L, 68L, 69L, 83L, 70L, 70L,
71L, 73L, 76L, 77L, 82L, 74L, 71L, 70L, 71L, 77L, 71L, 66L, 65L,
74L, 68L, 66L, 79L, 82L, 79L, 71L, 73L, 75L, 79L, 80L, 76L, 71L,
70L, 74L, 70L, 72L, 75L, 71L, 71L, 70L, 74L, 72L, 83L, 68L, 71L,
82L, 79L, 72L, 70L, 67L, 66L, 66L, 65L, 68L, 68L, 65L, 63L, 65L,
68L, 73L, 69L, 74L, 77L, 68L, 67L, 65L, 67L, 72L, 74L, 75L, 74L,
76L, 73L, 72L, 73L, 77L, 75L, 71L, 73L, 73L, 71L, 72L, 74L, 70L,
66L, 72L, 72L, 70L, 67L, 69L, 69L, 75L, 73L, 75L, 83L, 71L, 69L,
66L, 66L, 79L, 74L, 67L, 64L, 68L, 70L, 67L, 68L, 73L, 70L, 73L,
72L, 69L, 77L, 77L, 76L, 82L, 77L, 73L, 71L, 79L, 84L, 84L, 74L,
76L, 72L, 73L, 76L, 75L, 73L), v5 = c(41L, 44L, 40L, 39L,
37L, 40L, 40L, 42L, 39L, 37L, 39L, 37L, 36L, 34L, 34L, 35L, 35L,
32L, 33L, 33L, 32L, 32L, 31L, 30L, 32L, 32L, 30L, 31L, 32L, 34L,
33L, 34L, 35L, 44L, 36L, 39L, 35L, 35L, 35L, 32L, 34L, 36L, 36L,
35L, 36L, 36L, 44L, 39L, 38L, 42L, 44L, 44L, 39L, 39L, 39L, 39L,
37L, 37L, 39L, 38L, 39L, 36L, 35L, 34L, 33L, 32L, 28L, 31L, 29L,
27L, 29L, 30L, 31L, 29L, 29L, 32L, 33L, 34L, 30L, 32L, 35L, 32L,
32L, 34L, 32L, 33L, 33L, 32L, 31L, 30L, 33L, 37L, 32L, 33L, 32L,
32L, 34L, 41L, 45L, 48L, 56L, 47L, 52L, 51L, 44L, 35L, 34L, 34L,
33L, 30L, 32L, 31L, 31L, 30L, 28L, 29L, 29L, 27L, 26L, 26L, 24L,
24L, 24L, 25L, 23L, 25L, 25L, 41L, 35L, 28L, 32L, 31L, 32L, 29L,
29L, 27L, 27L, 27L, 26L, 24L, 24L, 26L, 27L, 27L, 29L, 30L, 30L,
29L, 32L, 31L, 37L, 33L, 31L, 30L, 32L, 32L, 32L, 30L, 30L, 29L,
31L, 31L, 31L, 32L, 30L, 30L, 29L, 28L, 28L, 27L, 27L, 26L, 27L,
25L, 27L, 24L, 23L, 23L, 25L, 25L, 27L, 27L, 28L, 25L, 24L, 25L,
26L, 25L, 26L, 24L, 24L, 24L, 23L, 25L, 25L, 37L, 29L, 28L, 29L,
27L, 33L, 33L, 38L, 33L, 31L, 31L, 32L, 35L, 31L, 28L, 28L, 30L,
29L, 29L, 34L, 43L, 42L, 37L, 34L, 32L, 36L, 31L, 29L, 28L, 27L,
28L, 26L, 24L, 25L, 25L, 24L, 24L, 24L, 25L, 25L, 23L, 25L, 26L,
26L, 24L, 24L, 24L, 24L, 24L, 23L, 23L, 23L, 24L, 22L, 25L, 25L,
26L, 28L, 28L, 34L, 30L, 28L, 29L, 31L, 31L, 31L, 33L, 32L, 32L,
34L, 32L, 33L, 34L, 34L, 33L, 35L, 34L, 32L, 31L, 29L, 30L, 28L,
28L, 28L, 28L, 27L, 28L, 28L, 29L, 28L, 29L, 28L, 27L, 27L, 27L,
27L, 37L, 32L, 31L, 30L, 30L, 30L, 34L, 30L, 30L, 30L, 30L, 30L,
29L, 31L, 32L, 33L, 39L, 33L, 32L, 34L, 37L, 40L, 37L, 36L, 38L,
38L, 36L, 38L, 38L, 39L), v6 = c(6L, 6L, 6L, 6L, 5L,
6L, 7L, 6L, 6L, 5L, 6L, 5L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L,
5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 6L,
6L, 5L, 6L, 6L, 6L, 6L, 7L, 6L, 6L, 8L, 7L, 7L, 7L, 7L, 7L, 5L,
5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 5L, 5L, 5L, 4L,
4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 5L, 6L, 5L, 5L,
5L, 6L, 6L, 6L, 5L, 6L, 7L, 6L, 7L, 6L, 6L, 6L, 7L, 9L, 7L, 7L,
8L, 8L, 8L, 6L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L,
5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 5L,
6L, 9L, 7L, 7L, 6L, 6L, 6L, 7L, 6L, 6L, 6L, 5L, 5L, 5L, 5L, 6L,
6L, 5L, 6L, 6L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L,
6L, 7L, 6L, 7L, 6L, 6L, 5L, 6L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 7L,
6L, 7L, 7L, 6L, 7L, 10L, 7L, 7L, 7L, 7L, 8L, 7L, 6L, 6L, 5L,
5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 4L, 5L, 5L,
5L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
4L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 9L, 7L, 7L, 7L, 6L, 7L,
6L, 7L, 6L, 7L, 8L, 7L, 7L, 6L, 6L, 6L, 6L, 6L, 6L, 5L, 6L, 5L,
5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 5L,
6L, 6L, 6L, 6L, 6L, 7L, 6L, 7L, 6L, 8L, 8L, 7L, 7L, 7L, 7L, 10L,
8L, 8L, 7L, 8L, 8L, 7L, 7L, 7L, 7L, 6L, 6L, 7L, 6L), v7 = c(83L,
84L, 81L, 90L, 79L, 78L, 78L, 81L, 78L, 75L, 76L, 77L, 75L, 77L,
79L, 82L, 85L, 81L, 80L, 81L, 81L, 82L, 85L, 80L, 77L, 82L, 83L,
76L, 73L, 74L, 78L, 73L, 77L, 74L, 72L, 70L, 72L, 73L, 70L, 70L,
72L, 75L, 74L, 73L, 73L, 77L, 82L, 81L, 79L, 82L, 86L, 86L, 85L,
79L, 79L, 77L, 76L, 75L, 75L, 78L, 78L, 77L, 74L, 72L, 68L, 69L,
72L, 69L, 72L, 71L, 71L, 72L, 69L, 69L, 72L, 71L, 70L, 72L, 75L,
73L, 74L, 72L, 74L, 75L, 71L, 71L, 73L, 72L, 71L, 70L, 72L, 73L,
72L, 75L, 76L, 76L, 75L, 80L, 83L, 100L, 95L, 84L, 84L, 89L,
76L, 69L, 68L, 67L, 66L, 64L, 67L, 69L, 64L, 63L, 63L, 67L, 66L,
65L, 69L, 64L, 62L, 62L, 63L, 63L, 60L, 63L, 66L, 69L, 64L, 67L,
68L, 63L, 64L, 63L, 61L, 61L, 57L, 64L, 61L, 68L, 65L, 74L, 67L,
66L, 67L, 73L, 69L, 68L, 64L, 68L, 72L, 73L, 69L, 72L, 75L, 80L,
94L, 83L, 81L, 79L, 76L, 72L, 73L, 74L, 74L, 72L, 69L, 70L, 78L,
78L, 81L, 76L, 75L, 76L, 75L, 73L, 74L, 73L, 73L, 72L, 75L, 72L,
76L, 70L, 71L, 70L, 71L, 70L, 69L, 66L, 66L, 63L, 70L, 68L, 68L,
79L, 72L, 75L, 78L, 75L, 75L, 77L, 79L, 82L, 85L, 82L, 83L, 87L,
100L, 89L, 86L, 81L, 84L, 78L, 83L, 92L, 100L, 90L, 87L, 81L,
82L, 79L, 79L, 79L, 81L, 79L, 79L, 76L, 78L, 74L, 73L, 68L, 73L,
71L, 73L, 71L, 72L, 69L, 73L, 70L, 71L, 69L, 73L, 70L, 70L, 73L,
73L, 73L, 69L, 73L, 74L, 76L, 75L, 76L, 77L, 79L, 81L, 78L, 82L,
81L, 94L, 100L, 93L, 91L, 88L, 86L, 90L, 83L, 82L, 82L, 81L,
81L, 82L, 84L, 82L, 81L, 80L, 82L, 81L, 81L, 80L, 78L, 77L, 75L,
72L, 75L, 72L, 73L, 75L, 73L, 75L, 83L, 78L, 77L, 77L, 77L, 75L,
78L, 80L, 77L, 73L, 79L, 79L, 76L, 88L, 91L, 90L, 80L, 82L, 82L,
82L, 85L, 99L, 100L, 97L, 91L, 89L, 82L, 85L, 82L, 83L), v8 = c(610L,
765L, 713L, 685L, 601L, 535L, 582L, 568L, 502L, 608L, 653L, 672L,
694L, 697L, 715L, 751L, 675L, 706L, 777L, 787L, 876L, 823L, 754L,
782L, 834L, 907L, 890L, 913L, 921L, 977L, 890L, 947L, 996L, 830L,
974L, 921L, 912L, 907L, 871L, 805L, 876L, 909L, 861L, 865L, 901L,
742L, 726L, 720L, 803L, 796L, 857L, 902L, 751L, 806L, 859L, 798L,
714L, 728L, 688L, 728L, 785L, 1166L, 1105L, 935L, 1037L, 1016L,
1037L, 932L, 1013L, 996L, 1016L, 1064L, 1104L, 1003L, 1051L,
913L, 944L, 1044L, 1018L, 1073L, 1109L, 1055L, 1076L, 1008L,
1016L, 996L, 1050L, 1030L, 969L, 1011L, 932L, 890L, 978L, 1008L,
928L, 1006L, 927L, 913L, 905L, 952L, 957L, 978L, 978L, 1044L,
1341L, 966L, 881L, 1052L, 981L, 864L, 927L, 887L, 943L, 1055L,
1010L, 1012L, 1059L, 913L, 1028L, 1060L, 1046L, 1061L, 1043L,
1027L, 1094L, 1065L, 1070L, 1000L, 1079L, 1114L, 1156L, 1069L,
1157L, 1234L, 1217L, 1216L, 1190L, 1208L, 1253L, 1182L, 1133L,
1046L, 1122L, 1013L, 1185L, 1208L, 1177L, 1227L, 1080L, 1197L,
1123L, 1260L, 1101L, 1139L, 1054L, 1222L, 1262L, 1158L, 1241L,
1190L, 1087L, 1155L, 1122L, 1159L, 1044L, 999L, 993L, 1193L,
1229L, 1217L, 1301L, 1239L, 1179L, 1092L, 1226L, 1211L, 1236L,
1327L, 1133L, 1149L, 1198L, 1158L, 1312L, 1183L, 1165L, 1163L,
1226L, 1136L, 1130L, 1129L, 1092L, 1039L, 1019L, 1196L, 1155L,
1169L, 1130L, 1185L, 1166L, 1174L, 1048L, 1083L, 1048L, 1161L,
997L, 1041L, 1123L, 895L, 1034L, 1095L, 1080L, 1223L, 1074L,
954L, 948L, 1011L, 982L, 1013L, 1078L, 1080L, 1055L, 1131L, 1145L,
999L, 1213L, 1192L, 1144L, 1082L, 1137L, 1150L, 1104L, 1059L,
1039L, 1099L, 1202L, 1092L, 1072L, 1126L, 1086L, 1098L, 1131L,
1071L, 1122L, 1061L, 988L, 1043L, 760L, 1073L, 950L, 1001L, 960L,
1034L, 919L, 922L, 944L, 996L, 970L, 996L, 996L, 1058L, 1235L,
964L, 1043L, 979L, 865L, 1012L, 906L, 987L, 925L, 847L, 1012L,
1011L, 1065L, 987L, 1078L, 1025L, 1010L, 1045L, 981L, 987L, 1125L,
1184L, 1070L, 995L, 1139L, 1205L, 1286L, 1180L, 1210L, 1147L,
1221L, 1112L, 1151L, 1117L, 1097L, 1066L, 1059L, 1050L, 1040L,
976L, 992L, 979L, 949L, 954L, 932L, 873L, 1015L, 982L, 982L,
1010L, 897L, 1056L, 1217L, 977L, 986L, 1004L, 906L, 890L, 877L,
894L, 672L)), row.names = c(NA, -321L), class = "data.frame")
x <- AllData[2:9]
y <- AllData[2:9]
correlationcoef <- data.frame(cor(x,y,method="kendall"))
I used the above code to run the data but it only gives me the correlation coefficient,
not the p-value that I needed. I also need to store this value into one data frame so
that I will be able to evaluate all correlations in one go.
One could use a loop, but another approach to getting the p-values of the kendall correlation test is to use the rstatix package to create a correlation matrix and a corresponding p-value matrix:
library(rstatix)
# sample data
AllData <- data.frame(
Date = c("2014-01-05", "2014-01-12","2014-01-19", "2014-01-26","2014-02-02", "2014-02-09"),
v1 = c(39,40,39,37,39,44),
v2 = c(4,6,5,5,5,6),
v3 = c(84,86,82,100,83,82),
v4 = c(75,77,73,71,70,78),
v5 = c(41,44,40,39,37,40),
v6 = c(6,6,6,6,5,6),
v7 = c(83,84,81,90,79,78),
v8 = c(610,765,713,685,601,535)
)
# get the correlation matrix
corMatrix <- AllData %>% cor_mat(v1:v8, method = "kendall")
corMatrix
# get the p.values
corMatrix_p <- corMatrix %>% cor_get_pval()
corMatrix_p
And you can specify the variables you want to include in the matrix with the varsargument:
cor_mat(data, ..., vars = NULL, method = "pearson", alternative =
"two.sided", conf.level = 0.95)
Just set vars equal to a character vector of the variable names. In other words, you could also do this:
corMatrix <- AllData %>% cor_mat(c("v1","v2","v3","v4","v5","v6","v7","v8"), method = "kendall")
corMatrix
# get the p.values
corMatrix_p <- corMatrix %>% cor_get_pval()
corMatrix_p
I have correlogram as below, using this code:
corMatrix <- myfiles %>% cor_mat(c("v1","v2","v3",
"v4","v5","v6",
"v7","v8","v9","v10",
"v11","v12","v13"),
method = "kendall")
cor_plot(corMatrix,method="color",
type="full",
p.mat = corMatrix_p, insig = "blank")
Below is the data structure for myfiles
myfiles <- structure(list(Date = structure(c(16075, 16082, 16089, 16096,
16103, 16110, 16117, 16124, 16131, 16138, 16145, 16152, 16159,
16166, 16173, 16180, 16187, 16194, 16201, 16208, 16215, 16222,
16229, 16236, 16243, 16250, 16257, 16264, 16271, 16278, 16285,
16292, 16299, 16306, 16313, 16320, 16327, 16334, 16341, 16348,
16355, 16362, 16369, 16376, 16383, 16390, 16397, 16404, 16411,
16418, 16425, 16432, 16439, 16446, 16453, 16460, 16467, 16474,
16481, 16488, 16495, 16502, 16509, 16516, 16523, 16530, 16537,
16544, 16551, 16558, 16565, 16572, 16579, 16586, 16593, 16600,
16607, 16614, 16621, 16628, 16635, 16642, 16649, 16656, 16663,
16670, 16677, 16684, 16691, 16698, 16705, 16712, 16719, 16726,
16733, 16740, 16747, 16754, 16761, 16768, 16775, 16782, 16789,
16796, 16803, 16810, 16817, 16824, 16831, 16838, 16845, 16852,
16859, 16866, 16873, 16880, 16887, 16894, 16901, 16908, 16915,
16922, 16929, 16936, 16943, 16950, 16957, 16964, 16971, 16978,
16985, 16992, 16999, 17006, 17013, 17020, 17027, 17034, 17041,
17048, 17055, 17062, 17069, 17076, 17083, 17090, 17097, 17104,
17111, 17118, 17125, 17132, 17139, 17146, 17153, 17160, 17167,
17174, 17181, 17188, 17195, 17202, 17209, 17216, 17223, 17230,
17237, 17244, 17251, 17258, 17265, 17272, 17279, 17286, 17293,
17300, 17307, 17314, 17321, 17328, 17335, 17342, 17349, 17356,
17363, 17370, 17377, 17384, 17391, 17398, 17405, 17412, 17419,
17426, 17433, 17440, 17447, 17454, 17461, 17468, 17475, 17482,
17489, 17496, 17503, 17510, 17517, 17524, 17531, 17538, 17545,
17552, 17559, 17566, 17573, 17580, 17587, 17594, 17601, 17608,
17615, 17622, 17629, 17636, 17643, 17650, 17657, 17664, 17671,
17678, 17685, 17692, 17699, 17706, 17713, 17720, 17727, 17734,
17741, 17748, 17755, 17762, 17769, 17776, 17783, 17790, 17797,
17804, 17811, 17818, 17825, 17832, 17839, 17846, 17853, 17860,
17867, 17874, 17881, 17888, 17895, 17902, 17909, 17916, 17923,
17930, 17937, 17944, 17951, 17958, 17965, 17972, 17979, 17986,
17993, 18000, 18007, 18014, 18021, 18028, 18035, 18042, 18049,
18056, 18063, 18070, 18077, 18084, 18091, 18098, 18105, 18112,
18119, 18126, 18133, 18140, 18147, 18154, 18161, 18168, 18175,
18182, 18189, 18196, 18203, 18210, 18217, 18224, 18231, 18238,
18245, 18252, 18259, 18266, 18273, 18280, 18287, 18294, 18301,
18308, 18315), class = "Date"), v1 = c(39L, 40L, 39L, 37L,
39L, 44L, 41L, 40L, 35L, 39L, 35L, 32L, 36L, 34L, 32L, 34L, 32L,
34L, 32L, 30L, 36L, 34L, 35L, 32L, 35L, 32L, 33L, 35L, 35L, 35L,
35L, 36L, 41L, 36L, 34L, 32L, 33L, 30L, 33L, 36L, 34L, 39L, 36L,
34L, 35L, 40L, 46L, 40L, 41L, 44L, 48L, 45L, 32L, 28L, 31L, 29L,
32L, 31L, 33L, 33L, 33L, 31L, 28L, 30L, 29L, 25L, 25L, 25L, 26L,
26L, 24L, 24L, 26L, 25L, 28L, 32L, 32L, 32L, 32L, 35L, 36L, 32L,
31L, 32L, 32L, 35L, 36L, 33L, 30L, 32L, 37L, 42L, 36L, 36L, 33L,
33L, 31L, 46L, 49L, 63L, 77L, 56L, 58L, 57L, 71L, 44L, 36L, 39L,
35L, 35L, 35L, 32L, 33L, 36L, 33L, 33L, 34L, 29L, 30L, 30L, 28L,
27L, 31L, 29L, 28L, 29L, 29L, 100L, 64L, 42L, 48L, 43L, 39L,
36L, 33L, 30L, 32L, 31L, 34L, 34L, 31L, 35L, 35L, 40L, 40L, 40L,
39L, 38L, 50L, 46L, 48L, 47L, 40L, 43L, 43L, 44L, 60L, 54L, 50L,
51L, 61L, 55L, 55L, 62L, 51L, 54L, 51L, 45L, 45L, 46L, 45L, 48L,
47L, 44L, 42L, 42L, 42L, 43L, 44L, 54L, 53L, 48L, 51L, 47L, 45L,
45L, 47L, 49L, 51L, 44L, 43L, 46L, 42L, 46L, 44L, 100L, 62L,
54L, 53L, 45L, 93L, 61L, 76L, 60L, 52L, 53L, 62L, 56L, 54L, 21L,
19L, 21L, 21L, 20L, 82L, 100L, 62L, 38L, 34L, 31L, 35L, 27L,
23L, 21L, 21L, 20L, 21L, 21L, 22L, 22L, 20L, 19L, 20L, 19L, 21L,
20L, 20L, 19L, 21L, 21L, 20L, 18L, 22L, 19L, 18L, 18L, 17L, 20L,
19L, 20L, 21L, 24L, 26L, 25L, 32L, 24L, 25L, 25L, 28L, 27L, 25L,
53L, 53L, 49L, 50L, 49L, 52L, 53L, 58L, 53L, 56L, 52L, 50L, 49L,
52L, 62L, 46L, 45L, 52L, 41L, 45L, 50L, 48L, 48L, 49L, 50L, 50L,
47L, 49L, 44L, 54L, 100L, 67L, 58L, 45L, 60L, 51L, 56L, 50L,
50L, 48L, 48L, 49L, 48L, 54L, 57L, 67L, 74L, 58L, 60L, 64L, 77L,
70L, 82L, 72L, 77L, 74L, 67L, 79L, 74L, 88L), v2 = c(4L,
6L, 5L, 5L, 5L, 6L, 5L, 5L, 4L, 4L, 5L, 5L, 6L, 6L, 6L, 5L, 5L,
5L, 5L, 4L, 5L, 5L, 4L, 6L, 5L, 4L, 5L, 5L, 6L, 4L, 4L, 4L, 5L,
5L, 5L, 5L, 4L, 5L, 6L, 5L, 6L, 6L, 4L, 6L, 6L, 6L, 6L, 5L, 6L,
4L, 7L, 6L, 5L, 5L, 7L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 4L, 5L, 4L,
4L, 6L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 3L, 5L, 4L, 4L, 4L, 5L, 4L,
4L, 4L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L, 4L, 6L,
5L, 7L, 7L, 5L, 7L, 9L, 7L, 6L, 6L, 5L, 5L, 5L, 4L, 6L, 5L, 6L,
4L, 5L, 5L, 5L, 4L, 4L, 5L, 4L, 5L, 4L, 4L, 4L, 5L, 3L, 5L, 4L,
5L, 4L, 5L, 4L, 4L, 5L, 4L, 5L, 4L, 5L, 4L, 4L, 4L, 4L, 5L, 5L,
5L, 5L, 5L, 4L, 4L, 7L, 6L, 5L, 4L, 5L, 7L, 8L, 8L, 8L, 8L, 7L,
7L, 8L, 8L, 8L, 8L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 5L, 7L, 8L, 6L,
6L, 6L, 6L, 6L, 6L, 8L, 7L, 7L, 8L, 7L, 8L, 8L, 6L, 7L, 6L, 6L,
8L, 7L, 7L, 7L, 6L, 7L, 8L, 8L, 8L, 10L, 8L, 5L, 7L, 7L, 9L,
8L, 3L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 3L, 3L, 4L, 3L, 3L, 3L,
3L, 3L, 3L, 2L, 2L, 2L, 2L, 3L, 3L, 2L, 2L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 4L, 2L, 3L, 3L, 2L, 3L, 4L, 4L, 4L, 4L, 3L,
3L, 4L, 4L, 5L, 4L, 8L, 7L, 8L, 7L, 5L, 7L, 8L, 8L, 7L, 7L, 7L,
9L, 6L, 9L, 8L, 6L, 6L, 8L, 7L, 7L, 8L, 7L, 7L, 7L, 8L, 7L, 7L,
6L, 7L, 7L, 8L, 6L, 7L, 6L, 8L, 6L, 5L, 9L, 6L, 8L, 7L, 6L, 6L,
7L, 6L, 7L, 8L, 8L, 8L, 7L, 10L, 10L, 10L, 11L, 11L, 10L, 9L,
10L, 10L, 9L), v3 = c(84L, 86L, 82L, 100L, 83L, 82L,
76L, 74L, 81L, 72L, 67L, 66L, 67L, 64L, 67L, 61L, 67L, 63L, 59L,
60L, 57L, 54L, 60L, 59L, 53L, 61L, 61L, 57L, 59L, 63L, 60L, 56L,
60L, 64L, 57L, 55L, 58L, 61L, 56L, 63L, 65L, 63L, 59L, 64L, 60L,
62L, 70L, 65L, 65L, 61L, 71L, 69L, 54L, 59L, 54L, 55L, 55L, 56L,
74L, 100L, 86L, 69L, 54L, 55L, 48L, 47L, 48L, 48L, 46L, 44L,
42L, 45L, 43L, 48L, 46L, 43L, 45L, 44L, 52L, 47L, 50L, 49L, 47L,
47L, 50L, 49L, 51L, 47L, 45L, 45L, 49L, 53L, 55L, 56L, 52L, 52L,
51L, 64L, 67L, 73L, 78L, 65L, 76L, 74L, 62L, 57L, 52L, 75L, 54L,
47L, 52L, 52L, 49L, 42L, 45L, 43L, 45L, 42L, 44L, 41L, 40L, 38L,
39L, 41L, 42L, 43L, 39L, 60L, 50L, 49L, 52L, 51L, 46L, 47L, 42L,
44L, 45L, 44L, 47L, 44L, 49L, 43L, 50L, 47L, 48L, 52L, 53L, 51L,
64L, 57L, 60L, 52L, 45L, 48L, 49L, 56L, 81L, 71L, 61L, 68L, 69L,
67L, 69L, 61L, 68L, 69L, 63L, 63L, 61L, 59L, 78L, 60L, 56L, 57L,
57L, 54L, 52L, 48L, 53L, 49L, 50L, 53L, 58L, 55L, 61L, 52L, 57L,
55L, 57L, 51L, 51L, 52L, 54L, 58L, 58L, 80L, 67L, 62L, 60L, 60L,
65L, 64L, 78L, 70L, 63L, 68L, 67L, 75L, 66L, 27L, 26L, 26L, 27L,
24L, 30L, 35L, 33L, 31L, 28L, 28L, 30L, 28L, 26L, 23L, 22L, 21L,
22L, 21L, 20L, 22L, 20L, 20L, 21L, 20L, 24L, 21L, 21L, 22L, 23L,
22L, 24L, 25L, 20L, 22L, 23L, 22L, 20L, 21L, 22L, 22L, 23L, 25L,
25L, 25L, 33L, 28L, 25L, 28L, 27L, 29L, 30L, 58L, 57L, 60L, 58L,
56L, 60L, 59L, 57L, 56L, 60L, 55L, 55L, 54L, 50L, 53L, 55L, 48L,
50L, 53L, 47L, 46L, 51L, 52L, 55L, 61L, 60L, 51L, 51L, 57L, 53L,
71L, 67L, 58L, 56L, 93L, 71L, 66L, 68L, 60L, 62L, 61L, 56L, 57L,
61L, 64L, 64L, 75L, 65L, 64L, 69L, 78L, 84L, 100L, 91L, 94L,
86L, 83L, 89L, 89L, 87L), v4 = c(75L, 77L, 73L, 71L, 70L,
78L, 76L, 72L, 71L, 72L, 75L, 75L, 70L, 74L, 72L, 74L, 74L, 73L,
69L, 74L, 72L, 71L, 74L, 72L, 72L, 82L, 74L, 83L, 78L, 73L, 73L,
80L, 88L, 88L, 74L, 68L, 70L, 76L, 72L, 76L, 75L, 76L, 71L, 77L,
96L, 85L, 100L, 90L, 81L, 80L, 87L, 86L, 81L, 77L, 81L, 74L,
73L, 74L, 76L, 71L, 84L, 79L, 74L, 74L, 72L, 80L, 72L, 73L, 70L,
69L, 69L, 77L, 72L, 77L, 72L, 77L, 77L, 85L, 77L, 74L, 77L, 77L,
76L, 77L, 75L, 77L, 79L, 73L, 71L, 73L, 78L, 78L, 76L, 74L, 74L,
75L, 81L, 86L, 95L, 91L, 85L, 83L, 90L, 92L, 72L, 67L, 72L, 77L,
68L, 64L, 68L, 73L, 75L, 71L, 71L, 70L, 69L, 72L, 68L, 67L, 65L,
65L, 63L, 64L, 64L, 67L, 64L, 80L, 73L, 70L, 100L, 73L, 78L,
62L, 63L, 66L, 60L, 61L, 61L, 62L, 61L, 73L, 71L, 70L, 69L, 67L,
67L, 68L, 64L, 73L, 75L, 70L, 67L, 64L, 68L, 76L, 71L, 73L, 75L,
71L, 74L, 68L, 68L, 72L, 71L, 70L, 69L, 69L, 69L, 71L, 73L, 73L,
68L, 71L, 68L, 64L, 65L, 73L, 66L, 67L, 69L, 72L, 80L, 66L, 69L,
68L, 66L, 72L, 67L, 75L, 75L, 69L, 70L, 68L, 69L, 83L, 70L, 70L,
71L, 73L, 76L, 77L, 82L, 74L, 71L, 70L, 71L, 77L, 71L, 66L, 65L,
74L, 68L, 66L, 79L, 82L, 79L, 71L, 73L, 75L, 79L, 80L, 76L, 71L,
70L, 74L, 70L, 72L, 75L, 71L, 71L, 70L, 74L, 72L, 83L, 68L, 71L,
82L, 79L, 72L, 70L, 67L, 66L, 66L, 65L, 68L, 68L, 65L, 63L, 65L,
68L, 73L, 69L, 74L, 77L, 68L, 67L, 65L, 67L, 72L, 74L, 75L, 74L,
76L, 73L, 72L, 73L, 77L, 75L, 71L, 73L, 73L, 71L, 72L, 74L, 70L,
66L, 72L, 72L, 70L, 67L, 69L, 69L, 75L, 73L, 75L, 83L, 71L, 69L,
66L, 66L, 79L, 74L, 67L, 64L, 68L, 70L, 67L, 68L, 73L, 70L, 73L,
72L, 69L, 77L, 77L, 76L, 82L, 77L, 73L, 71L, 79L, 84L, 84L, 74L,
76L, 72L, 73L, 76L, 75L, 73L), v5 = c(41L, 44L, 40L, 39L,
37L, 40L, 40L, 42L, 39L, 37L, 39L, 37L, 36L, 34L, 34L, 35L, 35L,
32L, 33L, 33L, 32L, 32L, 31L, 30L, 32L, 32L, 30L, 31L, 32L, 34L,
33L, 34L, 35L, 44L, 36L, 39L, 35L, 35L, 35L, 32L, 34L, 36L, 36L,
35L, 36L, 36L, 44L, 39L, 38L, 42L, 44L, 44L, 39L, 39L, 39L, 39L,
37L, 37L, 39L, 38L, 39L, 36L, 35L, 34L, 33L, 32L, 28L, 31L, 29L,
27L, 29L, 30L, 31L, 29L, 29L, 32L, 33L, 34L, 30L, 32L, 35L, 32L,
32L, 34L, 32L, 33L, 33L, 32L, 31L, 30L, 33L, 37L, 32L, 33L, 32L,
32L, 34L, 41L, 45L, 48L, 56L, 47L, 52L, 51L, 44L, 35L, 34L, 34L,
33L, 30L, 32L, 31L, 31L, 30L, 28L, 29L, 29L, 27L, 26L, 26L, 24L,
24L, 24L, 25L, 23L, 25L, 25L, 41L, 35L, 28L, 32L, 31L, 32L, 29L,
29L, 27L, 27L, 27L, 26L, 24L, 24L, 26L, 27L, 27L, 29L, 30L, 30L,
29L, 32L, 31L, 37L, 33L, 31L, 30L, 32L, 32L, 32L, 30L, 30L, 29L,
31L, 31L, 31L, 32L, 30L, 30L, 29L, 28L, 28L, 27L, 27L, 26L, 27L,
25L, 27L, 24L, 23L, 23L, 25L, 25L, 27L, 27L, 28L, 25L, 24L, 25L,
26L, 25L, 26L, 24L, 24L, 24L, 23L, 25L, 25L, 37L, 29L, 28L, 29L,
27L, 33L, 33L, 38L, 33L, 31L, 31L, 32L, 35L, 31L, 28L, 28L, 30L,
29L, 29L, 34L, 43L, 42L, 37L, 34L, 32L, 36L, 31L, 29L, 28L, 27L,
28L, 26L, 24L, 25L, 25L, 24L, 24L, 24L, 25L, 25L, 23L, 25L, 26L,
26L, 24L, 24L, 24L, 24L, 24L, 23L, 23L, 23L, 24L, 22L, 25L, 25L,
26L, 28L, 28L, 34L, 30L, 28L, 29L, 31L, 31L, 31L, 33L, 32L, 32L,
34L, 32L, 33L, 34L, 34L, 33L, 35L, 34L, 32L, 31L, 29L, 30L, 28L,
28L, 28L, 28L, 27L, 28L, 28L, 29L, 28L, 29L, 28L, 27L, 27L, 27L,
27L, 37L, 32L, 31L, 30L, 30L, 30L, 34L, 30L, 30L, 30L, 30L, 30L,
29L, 31L, 32L, 33L, 39L, 33L, 32L, 34L, 37L, 40L, 37L, 36L, 38L,
38L, 36L, 38L, 38L, 39L), v6 = c(6L, 6L, 6L, 6L, 5L,
6L, 7L, 6L, 6L, 5L, 6L, 5L, 4L, 5L, 5L, 5L, 5L, 4L, 4L, 5L, 5L,
5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 6L,
6L, 5L, 6L, 6L, 6L, 6L, 7L, 6L, 6L, 8L, 7L, 7L, 7L, 7L, 7L, 5L,
5L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 5L, 5L, 5L, 4L,
4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 6L, 5L, 6L, 5L, 5L,
5L, 6L, 6L, 6L, 5L, 6L, 7L, 6L, 7L, 6L, 6L, 6L, 7L, 9L, 7L, 7L,
8L, 8L, 8L, 6L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 4L, 5L, 5L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 4L,
5L, 5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 5L,
6L, 9L, 7L, 7L, 6L, 6L, 6L, 7L, 6L, 6L, 6L, 5L, 5L, 5L, 5L, 6L,
6L, 5L, 6L, 6L, 6L, 6L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L,
6L, 7L, 6L, 7L, 6L, 6L, 5L, 6L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 7L,
6L, 7L, 7L, 6L, 7L, 10L, 7L, 7L, 7L, 7L, 8L, 7L, 6L, 6L, 5L,
5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 4L, 5L, 5L,
5L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
4L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 9L, 7L, 7L, 7L, 6L, 7L,
6L, 7L, 6L, 7L, 8L, 7L, 7L, 6L, 6L, 6L, 6L, 6L, 6L, 5L, 6L, 5L,
5L, 5L, 5L, 5L, 5L, 6L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 5L,
6L, 6L, 6L, 6L, 6L, 7L, 6L, 7L, 6L, 8L, 8L, 7L, 7L, 7L, 7L, 10L,
8L, 8L, 7L, 8L, 8L, 7L, 7L, 7L, 7L, 6L, 6L, 7L, 6L), v7 = c(83L,
84L, 81L, 90L, 79L, 78L, 78L, 81L, 78L, 75L, 76L, 77L, 75L, 77L,
79L, 82L, 85L, 81L, 80L, 81L, 81L, 82L, 85L, 80L, 77L, 82L, 83L,
76L, 73L, 74L, 78L, 73L, 77L, 74L, 72L, 70L, 72L, 73L, 70L, 70L,
72L, 75L, 74L, 73L, 73L, 77L, 82L, 81L, 79L, 82L, 86L, 86L, 85L,
79L, 79L, 77L, 76L, 75L, 75L, 78L, 78L, 77L, 74L, 72L, 68L, 69L,
72L, 69L, 72L, 71L, 71L, 72L, 69L, 69L, 72L, 71L, 70L, 72L, 75L,
73L, 74L, 72L, 74L, 75L, 71L, 71L, 73L, 72L, 71L, 70L, 72L, 73L,
72L, 75L, 76L, 76L, 75L, 80L, 83L, 100L, 95L, 84L, 84L, 89L,
76L, 69L, 68L, 67L, 66L, 64L, 67L, 69L, 64L, 63L, 63L, 67L, 66L,
65L, 69L, 64L, 62L, 62L, 63L, 63L, 60L, 63L, 66L, 69L, 64L, 67L,
68L, 63L, 64L, 63L, 61L, 61L, 57L, 64L, 61L, 68L, 65L, 74L, 67L,
66L, 67L, 73L, 69L, 68L, 64L, 68L, 72L, 73L, 69L, 72L, 75L, 80L,
94L, 83L, 81L, 79L, 76L, 72L, 73L, 74L, 74L, 72L, 69L, 70L, 78L,
78L, 81L, 76L, 75L, 76L, 75L, 73L, 74L, 73L, 73L, 72L, 75L, 72L,
76L, 70L, 71L, 70L, 71L, 70L, 69L, 66L, 66L, 63L, 70L, 68L, 68L,
79L, 72L, 75L, 78L, 75L, 75L, 77L, 79L, 82L, 85L, 82L, 83L, 87L,
100L, 89L, 86L, 81L, 84L, 78L, 83L, 92L, 100L, 90L, 87L, 81L,
82L, 79L, 79L, 79L, 81L, 79L, 79L, 76L, 78L, 74L, 73L, 68L, 73L,
71L, 73L, 71L, 72L, 69L, 73L, 70L, 71L, 69L, 73L, 70L, 70L, 73L,
73L, 73L, 69L, 73L, 74L, 76L, 75L, 76L, 77L, 79L, 81L, 78L, 82L,
81L, 94L, 100L, 93L, 91L, 88L, 86L, 90L, 83L, 82L, 82L, 81L,
81L, 82L, 84L, 82L, 81L, 80L, 82L, 81L, 81L, 80L, 78L, 77L, 75L,
72L, 75L, 72L, 73L, 75L, 73L, 75L, 83L, 78L, 77L, 77L, 77L, 75L,
78L, 80L, 77L, 73L, 79L, 79L, 76L, 88L, 91L, 90L, 80L, 82L, 82L,
82L, 85L, 99L, 100L, 97L, 91L, 89L, 82L, 85L, 82L, 83L), v8 = c(610L,
765L, 713L, 685L, 601L, 535L, 582L, 568L, 502L, 608L, 653L, 672L,
694L, 697L, 715L, 751L, 675L, 706L, 777L, 787L, 876L, 823L, 754L,
782L, 834L, 907L, 890L, 913L, 921L, 977L, 890L, 947L, 996L, 830L,
974L, 921L, 912L, 907L, 871L, 805L, 876L, 909L, 861L, 865L, 901L,
742L, 726L, 720L, 803L, 796L, 857L, 902L, 751L, 806L, 859L, 798L,
714L, 728L, 688L, 728L, 785L, 1166L, 1105L, 935L, 1037L, 1016L,
1037L, 932L, 1013L, 996L, 1016L, 1064L, 1104L, 1003L, 1051L,
913L, 944L, 1044L, 1018L, 1073L, 1109L, 1055L, 1076L, 1008L,
1016L, 996L, 1050L, 1030L, 969L, 1011L, 932L, 890L, 978L, 1008L,
928L, 1006L, 927L, 913L, 905L, 952L, 957L, 978L, 978L, 1044L,
1341L, 966L, 881L, 1052L, 981L, 864L, 927L, 887L, 943L, 1055L,
1010L, 1012L, 1059L, 913L, 1028L, 1060L, 1046L, 1061L, 1043L,
1027L, 1094L, 1065L, 1070L, 1000L, 1079L, 1114L, 1156L, 1069L,
1157L, 1234L, 1217L, 1216L, 1190L, 1208L, 1253L, 1182L, 1133L,
1046L, 1122L, 1013L, 1185L, 1208L, 1177L, 1227L, 1080L, 1197L,
1123L, 1260L, 1101L, 1139L, 1054L, 1222L, 1262L, 1158L, 1241L,
1190L, 1087L, 1155L, 1122L, 1159L, 1044L, 999L, 993L, 1193L,
1229L, 1217L, 1301L, 1239L, 1179L, 1092L, 1226L, 1211L, 1236L,
1327L, 1133L, 1149L, 1198L, 1158L, 1312L, 1183L, 1165L, 1163L,
1226L, 1136L, 1130L, 1129L, 1092L, 1039L, 1019L, 1196L, 1155L,
1169L, 1130L, 1185L, 1166L, 1174L, 1048L, 1083L, 1048L, 1161L,
997L, 1041L, 1123L, 895L, 1034L, 1095L, 1080L, 1223L, 1074L,
954L, 948L, 1011L, 982L, 1013L, 1078L, 1080L, 1055L, 1131L, 1145L,
999L, 1213L, 1192L, 1144L, 1082L, 1137L, 1150L, 1104L, 1059L,
1039L, 1099L, 1202L, 1092L, 1072L, 1126L, 1086L, 1098L, 1131L,
1071L, 1122L, 1061L, 988L, 1043L, 760L, 1073L, 950L, 1001L, 960L,
1034L, 919L, 922L, 944L, 996L, 970L, 996L, 996L, 1058L, 1235L,
964L, 1043L, 979L, 865L, 1012L, 906L, 987L, 925L, 847L, 1012L,
1011L, 1065L, 987L, 1078L, 1025L, 1010L, 1045L, 981L, 987L, 1125L,
1184L, 1070L, 995L, 1139L, 1205L, 1286L, 1180L, 1210L, 1147L,
1221L, 1112L, 1151L, 1117L, 1097L, 1066L, 1059L, 1050L, 1040L,
976L, 992L, 979L, 949L, 954L, 932L, 873L, 1015L, 982L, 982L,
1010L, 897L, 1056L, 1217L, 977L, 986L, 1004L, 906L, 890L, 877L,
894L, 672L)), row.names = c(NA, -321L), class = "data.frame")
Right now, using cor_plot, the end correlogram result is pictured as below.
I want to change the color, change the size of x and y axis title, and also add title for the correlogram matrix. What is the best way to do that? I already tried to use ggplot or corrplot, but it's not working as I hoped it would.
My basic idea is to compute the Means of chunks (column-wise) of a large matrix and store these Means as rows of a data frame. Note, the chunks have different sizes (number of rows) and these are stored in a vector vec1. Below is my code:
df <- setNames(data.frame(matrix(nrow = 4000, ncol = 3)),
c("Age","Weight", "height"))
#
i <- 1
j <- vec1[1] - 1
k <- 0
repeat {
elements <- as.vector(apply(mydata[i : (j + 1), 3:5], 2, mean))
df <- rbind(df, elements)
k <- k + 1
i = i + vec1[k]
j = j + vec1[k + 1]
if (j + 1 >= l){
break
}
}
N.B.: When I perform the computations manually without looping it works. But the result of the loop yields a 4000 * 3 matrix filled with NA apart from the first row.
vec1 is a vector with 4000 entries, and whose first 500 elements - head(vec1, 500) -are below:
c(15L, 45L, 111L, 32L, 25L, 13L, 144L, 31L, 150L, 124L, 22L,
94L, 60L, 156L, 4L, 30L, 12L, 12L, 16L, 23L, 242L, 58L, 65L,
17L, 63L, 193L, 148L, 162L, 79L, 6L, 22L, 30L, 188L, 44L, 7L,
130L, 49L, 10L, 87L, 11L, 6L, 113L, 113L, 100L, 42L, 5L, 64L,
127L, 73L, 36L, 13L, 120L, 44L, 34L, 153L, 10L, 35L, 205L, 31L,
102L, 181L, 26L, 105L, 75L, 42L, 122L, 42L, 221L, 216L, 120L,
50L, 171L, 56L, 1L, 89L, 11L, 103L, 167L, 96L, 31L, 67L, 182L,
114L, 45L, 4L, 118L, 19L, 243L, 241L, 48L, 36L, 64L, 94L, 63L,
16L, 8L, 213L, 26L, 127L, 139L, 71L, 91L, 133L, 23L, 88L, 31L,
28L, 70L, 112L, 6L, 25L, 82L, 17L, 24L, 196L, 39L, 78L, 23L,
73L, 110L, 64L, 87L, 84L, 11L, 101L, 19L, 6L, 25L, 39L, 59L,
68L, 31L, 183L, 52L, 142L, 63L, 41L, 214L, 19L, 120L, 85L, 104L,
3L, 8L, 38L, 11L, 12L, 21L, 12L, 53L, 37L, 85L, 106L, 12L, 31L,
106L, 75L, 10L, 121L, 60L, 137L, 96L, 177L, 102L, 97L, 145L,
52L, 11L, 112L, 73L, 67L, 8L, 235L, 203L, 182L, 168L, 101L, 144L,
238L, 73L, 38L, 85L, 56L, 14L, 162L, 131L, 14L, 154L, 28L, 30L,
75L, 88L, 268L, 169L, 255L, 127L, 111L, 63L, 42L, 156L, 12L,
22L, 71L, 140L, 110L, 33L, 99L, 79L, 47L, 7L, 131L, 69L, 10L,
61L, 2L, 57L, 96L, 111L, 41L, 250L, 77L, 22L, 198L, 187L, 15L,
108L, 130L, 76L, 190L, 249L, 68L, 117L, 79L, 2L, 13L, 108L, 9L,
39L, 42L, 43L, 149L, 62L, 47L, 66L, 85L, 197L, 109L, 21L, 263L,
54L, 13L, 61L, 72L, 73L, 80L, 46L, 7L, 110L, 128L, 236L, 27L,
240L, 61L, 23L, 82L, 157L, 92L, 95L, 6L, 137L, 237L, 2L, 20L,
45L, 48L, 200L, 20L, 127L, 21L, 64L, 49L, 38L, 108L, 11L, 16L,
108L, 18L, 62L, 15L, 61L, 81L, 28L, 20L, 33L, 50L, 222L, 267L,
29L, 3L, 44L, 46L, 3L, 212L, 53L, 67L, 131L, 43L, 3L, 123L, 134L,
106L, 91L, 194L, 2L, 97L, 43L, 39L, 65L, 96L, 233L, 36L, 81L,
6L, 57L, 29L, 10L, 17L, 10L, 92L, 28L, 168L, 78L, 52L, 227L,
86L, 134L, 58L, 65L, 175L, 20L, 113L, 33L, 143L, 11L, 87L, 101L,
19L, 106L, 63L, 68L, 38L, 263L, 140L, 45L, 169L, 268L, 182L,
114L, 88L, 39L, 6L, 53L, 244L, 84L, 99L, 46L, 53L, 1L, 111L,
88L, 115L, 93L, 35L, 124L, 145L, 262L, 47L, 10L, 84L, 20L, 159L,
207L, 102L, 48L, 79L, 28L, 51L, 77L, 3L, 58L, 20L, 81L, 54L,
46L, 29L, 12L, 74L, 28L, 4L, 18L, 18L, 38L, 29L, 157L, 108L,
94L, 56L, 23L, 92L, 60L, 86L, 39L, 59L, 85L, 14L, 53L, 23L, 88L,
130L, 8L, 149L, 65L, 71L, 88L, 31L, 67L, 83L, 106L, 44L, 35L,
23L, 76L, 90L, 271L, 12L, 167L, 30L, 87L, 3L, 7L, 15L, 159L,
199L, 7L, 35L, 193L, 207L, 6L, 98L, 61L, 81L, 95L, 66L, 2L, 65L,
242L, 221L, 51L, 6L, 5L, 265L, 119L, 126L, 7L, 159L, 74L, 63L,
188L, 15L, 42L, 26L, 41L, 116L, 50L, 62L, 121L, 67L, 1L, 10L,
192L, 59L, 42L, 84L, 187L, 26L, 32L, 35L, 60L, 117L, 227L, 20L,
20L, 125L, 191L, 24L, 270L, 13L, 14L, 59L, 214L, 96L, 100L, 15L,
22L, 100L, 49L, 146L, 137L, 257L, 93L, 91L, 23L, 234L, 108L,
52L, 7L, 124L, 48L, 2L, 42L, 82L, 99L, 85L, 11L, 141L, 185L,
30L, 1L, 269L, 83L, 25L, 187L, 122L, 222L, 11L, 201L, 95L, 40L,
146L, 75L, 218L, 3L, 39L, 76L, 205L, 21L, 23L, 36L, 43L, 105L,
89L, 10L, 155L, 32L, 144L, 160L, 181L, 144L, 139L, 5L, 2L, 26L,
48L, 55L, 177L, 178L, 108L, 221L, 149L, 32L, 77L, 29L, 160L,
115L, 23L, 193L, 113L, 1L, 154L, 87L, 239L, 221L, 36L, 100L,
34L, 42L, 77L, 62L, 20L, 73L, 81L, 17L, 21L, 33L, 3L, 33L, 84L,
92L, 31L, 9L, 65L, 187L, 62L, 87L, 48L, 218L, 6L, 41L, 90L, 102L,
67L, 27L, 1L, 270L, 159L, 46L, 31L, 50L, 19L, 2L, 30L, 35L, 211L,
103L, 12L, 99L, 75L, 37L, 99L, 83L, 49L, 38L, 125L, 53L, 29L,
11L, 23L, 50L, 41L, 114L, 72L, 44L, 32L, 105L, 25L, 67L, 203L,
24L, 82L, 167L, 205L, 28L, 89L, 75L, 52L, 36L, 29L, 16L, 137L,
95L, 230L, 43L, 4L, 194L, 12L, 21L, 25L, 6L, 176L, 48L, 6L, 142L,
24L, 15L, 101L, 160L, 43L, 9L, 125L, 122L, 53L, 55L, 226L, 241L,
259L, 150L, 142L, 47L, 89L, 13L, 2L, 173L, 147L, 5L, 15L, 159L,
7L, 27L, 117L, 97L, 38L, 71L, 7L, 35L, 91L, 172L, 149L, 103L,
51L, 117L, 67L, 142L, 63L, 53L, 87L, 105L, 2L, 1L, 17L, 30L,
114L, 55L, 202L, 34L, 70L, 50L, 37L, 167L, 45L, 7L, 102L, 238L,
176L, 27L, 7L, 86L, 43L, 269L, 88L, 1L, 18L, 41L, 14L, 71L, 88L,
144L, 44L, 19L, 189L, 258L, 76L, 13L, 44L, 20L, 152L, 133L, 86L,
32L, 1L, 56L, 140L, 65L, 74L, 131L, 155L, 40L, 40L, 112L, 186L,
178L, 249L, 42L, 184L, 43L, 5L, 13L, 90L, 111L, 173L, 220L, 71L,
223L, 5L, 178L, 42L, 126L, 56L, 6L, 15L, 249L, 254L, 148L, 60L,
133L, 218L, 111L, 29L, 77L, 16L, 71L, 128L, 100L, 4L, 13L, 72L,
21L, 133L, 130L, 51L, 62L, 14L, 189L, 99L, 32L, 211L, 5L, 15L,
35L, 72L, 153L, 59L, 85L, 165L, 18L, 51L, 21L, 123L, 15L, 93L,
53L, 2L, 210L, 126L, 196L, 62L, 156L, 57L, 179L, 79L, 27L, 22L,
52L, 167L, 33L, 150L, 72L, 30L, 3L, 65L, 36L, 89L, 54L, 18L,
55L, 137L, 119L, 258L, 33L, 21L, 32L, 116L, 12L, 176L, 91L, 168L,
74L, 6L, 4L, 138L, 149L, 39L, 47L, 49L, 81L, 35L, 61L, 4L, 58L,
31L, 172L, 30L, 27L, 184L, 41L, 51L, 24L, 115L, 81L, 71L, 61L,
154L, 206L, 182L, 149L, 42L, 49L, 6L, 104L, 2L, 217L, 27L, 148L,
37L, 159L, 182L, 139L, 49L, 30L, 41L, 20L, 2L, 15L, 35L, 157L,
86L, 261L, 161L, 145L, 105L, 87L, 220L, 12L, 99L, 233L, 190L,
59L, 95L, 151L, 38L, 46L, 32L, 56L, 48L, 71L, 22L, 44L, 143L,
34L, 34L, 7L, 20L, 87L, 106L, 114L, 26L, 7L, 110L, 93L, 113L,
83L, 76L, 43L, 22L, 2L, 101L, 22L, 65L, 17L, 112L, 116L, 138L,
122L, 68L, 5L, 247L, 155L, 149L, 4L, 49L, 130L, 46L, 13L, 223L,
74L, 15L, 175L, 24L, 2L, 96L, 114L, 125L, 56L, 27L, 67L, 30L,
206L, 38L, 42L, 9L, 118L, 24L, 11L, 156L, 109L, 154L, 40L, 175L,
107L, 193L, 30L, 75L, 72L, 44L, 232L, 37L, 130L, 47L, 81L, 18L,
120L, 126L, 93L, 51L, 138L, 6L, 47L, 76L, 65L, 91L, 14L, 92L,
45L, 73L, 107L, 42L, 87L, 158L, 124L, 14L, 151L, 11L, 148L, 122L,
36L, 169L, 149L, 41L, 152L, 116L, 122L, 39L, 196L, 124L, 142L,
12L, 21L, 107L, 4L, 236L, 18L, 193L, 225L, 31L, 147L, 151L, 14L,
63L, 12L, 79L, 55L, 198L, 7L, 84L, 101L, 22L, 194L, 150L, 5L,
20L, 153L, 45L, 231L, 33L, 44L, 174L, 171L, 74L, 9L, 114L, 97L,
107L, 7L, 87L, 113L, 49L, 14L, 32L, 1L, 43L, 131L, 43L, 22L,
32L, 36L, 201L, 206L, 18L, 170L, 79L, 55L, 218L, 198L, 10L, 51L,
35L, 144L, 163L, 255L, 23L, 180L, 20L, 40L, 89L, 107L, 82L, 67L,
115L, 255L, 14L, 155L, 9L, 53L, 55L, 16L, 38L, 16L, 26L, 155L,
4L, 154L, 147L, 223L, 57L, 75L, 54L, 50L, 104L, 79L, 145L, 71L,
39L, 110L, 20L, 23L, 10L, 110L, 67L, 171L, 16L, 5L, 28L, 163L,
204L, 250L, 144L, 101L, 18L, 36L, 139L, 10L, 102L, 57L, 125L,
66L, 33L, 20L, 188L, 15L, 41L, 20L, 112L, 109L, 64L, 28L, 10L,
149L, 196L, 108L, 26L, 173L, 1L, 58L, 185L, 35L, 44L, 37L, 106L,
45L, 58L, 162L, 34L, 151L, 122L, 48L, 8L, 9L, 33L, 4L, 21L, 105L,
36L, 32L, 133L, 55L, 87L, 18L, 18L, 6L, 46L, 79L, 113L, 17L,
70L, 138L, 22L, 42L, 104L, 43L, 9L, 24L, 94L, 142L, 31L, 241L,
23L, 2L, 86L, 62L, 36L, 80L, 2L, 76L, 89L, 160L, 13L, 12L, 4L,
57L, 25L, 85L, 22L, 88L, 170L, 120L, 218L, 14L, 75L, 12L, 9L,
198L, 225L, 139L, 75L, 1L, 6L, 35L, 23L, 67L, 19L, 157L, 68L,
69L, 9L, 6L, 57L, 18L, 169L, 255L, 3L, 20L, 8L, 54L, 94L, 154L,
34L, 151L, 52L, 68L, 85L, 107L, 9L, 232L, 165L, 50L, 153L, 14L,
200L, 78L, 94L, 140L, 222L, 143L, 56L, 37L, 101L, 83L, 48L, 53L,
38L, 155L, 8L, 132L, 148L, 39L, 53L, 151L, 3L, 5L, 59L, 3L, 56L,
100L, 37L, 65L, 192L, 30L, 212L, 70L, 149L, 10L, 43L, 92L, 28L,
97L, 20L, 105L, 133L, 134L, 4L, 65L, 83L, 16L, 158L, 168L, 119L,
47L, 55L, 51L, 38L, 80L, 16L, 124L, 105L, 68L, 178L, 23L, 15L,
177L, 146L, 71L, 7L, 2L, 36L, 7L, 3L, 89L, 54L, 42L, 67L, 133L,
64L, 44L, 39L, 119L, 64L, 15L, 44L, 73L, 41L, 49L, 92L, 8L, 110L,
167L, 59L, 224L, 102L, 23L, 6L, 69L, 126L, 97L, 240L, 21L, 32L,
52L, 59L, 34L, 17L, 12L, 270L, 60L, 119L, 103L, 92L, 218L, 62L,
127L, 15L, 65L, 64L, 63L, 17L, 135L, 67L, 49L, 149L, 24L, 24L,
24L, 54L, 27L, 167L, 7L, 8L, 53L, 72L, 85L, 47L, 92L, 36L, 158L,
113L, 26L, 126L, 3L, 127L, 19L, 27L, 98L, 34L, 82L, 217L, 44L,
105L, 104L, 65L, 35L, 63L, 82L, 41L, 167L, 12L, 136L, 52L, 205L,
18L, 96L, 136L, 74L, 163L, 52L, 194L, 32L, 74L, 217L, 11L, 54L,
228L, 33L, 22L, 51L, 42L, 52L, 8L, 235L, 250L, 38L, 130L, 126L,
57L, 18L, 53L, 108L, 126L, 54L, 128L, 17L, 230L, 40L, 49L, 31L,
38L, 42L, 18L, 14L, 203L, 114L, 73L, 226L, 4L, 4L, 271L, 48L,
86L, 221L, 18L, 55L, 176L, 119L, 255L, 18L, 124L, 63L, 58L, 77L,
159L, 118L, 116L, 71L, 123L, 22L, 38L, 61L, 114L, 114L, 1L, 104L,
115L, 9L, 192L, 4L, 199L, 118L, 199L, 4L, 13L, 114L, 175L, 11L,
39L, 189L, 30L, 113L, 112L, 13L, 102L, 11L, 26L, 130L, 2L, 47L,
90L, 77L, 184L, 76L, 15L, 116L, 166L, 20L, 21L, 3L, 136L, 108L,
106L, 87L, 60L, 78L, 106L, 18L, 45L, 85L, 41L, 11L, 85L, 46L,
33L, 244L, 26L, 35L, 14L, 8L, 45L, 98L, 7L, 203L, 9L, 118L, 70L,
85L, 178L, 23L, 8L, 29L, 221L, 171L, 67L, 106L, 118L, 95L, 216L,
32L, 177L, 72L, 16L, 21L, 161L, 49L, 52L, 80L, 174L, 5L, 70L,
41L, 43L, 13L, 238L, 5L, 70L, 128L, 152L, 53L, 128L, 18L, 19L,
107L, 70L, 94L, 119L, 63L, 2L, 7L, 2L, 208L, 128L, 37L, 73L,
8L, 166L, 243L, 216L, 137L, 115L, 178L, 32L, 31L, 49L, 13L, 4L,
217L, 4L, 40L, 48L, 24L, 127L, 25L, 46L, 238L, 107L, 28L, 76L,
54L, 97L, 104L, 9L, 142L, 4L, 32L, 21L, 46L, 36L, 11L, 75L, 175L,
46L, 109L, 25L, 106L, 115L, 78L, 69L, 152L, 2L, 51L, 10L, 63L,
142L, 66L, 168L, 78L, 11L, 147L, 271L, 90L, 88L, 10L, 143L, 71L,
202L, 259L, 133L, 23L, 71L, 238L, 37L, 38L, 24L, 64L, 133L, 8L,
194L, 24L, 92L, 25L, 230L, 195L, 34L, 162L, 18L, 69L, 75L, 18L,
20L, 34L, 99L, 24L, 152L, 83L, 24L, 4L, 41L, 103L, 77L, 86L,
23L, 46L, 53L, 63L, 98L, 54L, 17L, 122L, 9L, 25L, 237L, 71L,
82L, 42L, 259L, 37L, 35L, 21L, 77L, 2L, 5L, 2L, 41L, 46L, 26L,
100L, 265L, 224L, 45L, 68L, 263L, 136L, 243L, 109L, 122L, 25L,
186L, 1L, 7L, 135L, 116L, 18L, 32L, 94L, 192L, 29L, 184L, 174L,
41L, 71L, 14L, 125L, 61L, 70L, 178L, 90L, 7L, 14L, 194L, 167L,
5L, 2L, 21L, 100L, 60L, 230L, 66L, 10L, 162L, 39L, 99L, 91L,
65L, 22L, 162L, 139L, 43L, 230L, 59L, 61L, 168L, 14L, 23L, 73L,
35L, 141L, 73L, 71L, 44L, 59L, 131L, 127L, 68L, 122L, 164L, 2L,
17L, 111L, 4L, 34L, 147L, 33L, 11L, 33L, 54L, 48L, 235L, 136L,
27L, 57L, 8L, 86L, 63L, 86L, 24L, 212L, 92L, 131L, 113L, 47L,
132L, 5L, 175L, 12L, 51L, 81L, 29L, 232L, 126L, 20L, 157L, 158L,
17L, 16L, 62L, 25L, 74L, 58L, 25L, 35L, 85L, 61L, 112L, 241L,
135L, 183L, 77L, 41L, 12L, 101L, 12L, 25L, 113L, 38L, 28L, 95L,
232L, 6L, 98L, 67L, 13L, 46L, 9L, 107L, 88L, 164L, 79L, 18L,
13L, 200L, 20L, 152L, 107L, 40L, 31L, 146L, 121L, 75L, 6L, 237L,
153L, 150L, 161L, 198L, 174L, 167L, 15L, 154L, 160L, 171L, 169L,
23L, 22L, 187L, 226L, 40L, 213L, 87L, 269L, 136L, 153L, 103L,
141L, 21L, 79L, 22L, 144L, 119L, 1L, 11L, 13L, 7L, 128L, 43L,
77L, 50L, 142L, 79L, 5L, 182L, 19L, 39L, 5L, 63L, 228L, 13L,
5L, 49L, 58L, 14L, 145L, 129L, 102L, 211L, 152L, 43L, 269L, 67L,
36L, 10L, 103L, 98L, 83L, 13L, 25L, 155L, 11L, 33L, 127L, 79L,
46L, 64L, 40L, 88L, 23L, 52L, 204L, 125L, 39L, 10L, 184L, 38L,
113L, 123L, 68L, 69L, 126L, 7L, 36L, 43L, 3L, 243L, 82L, 50L,
109L, 122L, 44L, 40L, 41L, 140L, 134L, 168L, 122L, 16L, 2L, 61L,
37L, 73L, 163L, 70L, 18L, 9L, 205L, 12L, 89L, 1L, 17L, 119L,
17L, 54L, 31L, 13L, 185L, 157L, 113L, 53L, 156L, 157L, 72L, 61L,
29L, 52L, 69L, 23L, 261L, 51L, 118L, 48L, 98L, 49L, 250L, 29L,
222L, 55L, 14L, 130L, 72L, 27L, 23L, 45L, 27L, 5L, 62L, 46L,
208L, 183L, 32L, 37L, 168L, 39L, 47L, 3L, 88L, 74L, 40L, 254L,
5L, 28L, 165L, 109L, 181L, 209L, 142L, 107L, 21L, 14L, 42L, 58L,
198L, 30L, 91L, 175L, 108L, 18L, 60L, 86L, 6L, 82L, 26L, 8L,
85L, 202L, 261L, 113L, 142L, 19L, 67L, 96L, 116L, 262L, 60L,
55L, 47L, 56L, 33L, 39L, 196L, 77L, 10L, 86L, 142L, 11L, 49L,
7L, 56L, 38L, 26L, 180L, 74L, 60L, 236L, 7L, 37L, 81L, 119L,
26L, 7L, 103L, 38L, 6L, 184L, 153L, 90L, 42L, 22L, 140L, 57L,
50L, 97L, 14L, 42L, 3L, 14L, 16L, 66L, 56L, 89L, 21L, 58L, 7L,
101L, 16L, 125L, 224L, 64L, 110L, 20L, 5L, 67L, 57L, 161L, 271L,
13L, 18L, 51L, 119L, 42L, 122L, 51L, 116L, 41L, 2L, 89L, 229L,
2L, 45L, 22L, 180L, 3L, 127L, 195L, 8L, 230L, 203L, 72L, 203L,
61L, 7L, 61L, 253L, 37L, 46L, 59L, 161L, 110L, 5L, 223L, 195L,
45L, 1L, 48L, 163L, 3L, 56L, 76L, 77L, 107L, 183L, 7L, 30L, 145L,
4L, 26L, 174L, 76L, 83L, 73L, 172L, 226L, 2L, 18L, 1L, 8L, 90L,
36L, 8L, 44L, 36L, 90L, 64L, 89L, 127L, 24L, 67L, 7L, 263L, 71L,
178L, 21L, 21L, 28L, 236L, 116L, 46L, 82L, 79L, 17L, 18L, 131L,
49L, 90L, 65L, 168L, 93L, 2L, 267L, 59L, 35L, 126L, 35L, 185L,
6L, 45L, 31L, 42L, 71L, 67L, 85L, 11L, 9L, 30L, 22L, 24L, 123L,
119L, 14L, 98L, 31L, 101L, 137L, 81L, 47L, 79L, 4L, 167L, 78L,
11L, 30L, 9L, 115L, 32L, 12L, 80L, 33L, 68L, 36L, 130L, 31L,
7L, 169L, 54L, 9L, 155L, 61L, 250L, 89L, 149L, 2L, 101L, 66L,
166L, 41L, 4L, 62L, 9L, 160L, 189L, 144L, 101L, 190L, 129L, 11L,
124L, 22L, 13L, 151L, 1L, 58L, 173L, 195L, 47L, 3L, 3L, 24L,
26L, 27L, 177L, 43L, 29L, 27L, 7L, 3L, 154L, 100L, 125L, 91L,
212L, 224L, 77L, 53L, 135L, 2L, 11L, 65L, 60L, 115L, 78L, 55L,
66L, 31L, 88L, 72L, 87L, 181L, 198L, 75L, 239L, 111L, 10L, 128L,
103L, 68L, 27L, 127L, 4L, 24L, 102L, 3L, 19L, 103L, 268L, 5L,
153L, 216L, 9L, 56L, 154L, 3L, 13L, 128L, 252L, 17L, 10L, 78L,
65L, 245L, 53L, 166L, 11L, 28L, 43L, 85L, 11L, 179L, 200L, 127L,
235L, 61L, 7L, 4L, 35L, 28L, 85L, 118L, 69L, 92L, 158L, 40L,
91L, 104L, 165L, 135L, 30L, 230L, 121L, 204L, 44L, 106L, 5L,
51L, 19L, 145L, 34L, 184L, 16L, 217L, 62L, 67L, 44L, 16L, 5L,
39L, 13L, 16L, 95L, 158L, 43L, 93L, 37L, 47L, 33L, 18L, 178L,
13L, 65L, 123L, 54L, 165L, 265L, 9L, 118L, 93L, 10L, 3L, 114L,
13L, 8L, 48L, 103L, 160L, 92L, 135L, 50L, 7L, 38L, 16L, 64L,
85L, 215L, 13L, 251L, 41L, 10L, 67L, 13L, 56L, 202L, 72L, 156L,
249L, 56L, 38L, 27L, 15L, 177L, 39L, 36L, 62L, 53L, 86L, 62L,
126L, 177L, 46L, 30L, 81L, 6L, 74L, 37L, 65L, 54L, 67L, 123L,
66L, 144L, 90L, 48L, 173L, 47L, 49L, 108L, 22L, 103L, 22L, 144L,
23L, 233L, 78L, 181L, 136L, 27L, 3L, 135L, 46L, 34L, 30L, 42L,
6L, 53L, 49L, 180L, 247L, 106L, 22L, 124L, 9L, 161L, 43L, 82L,
112L, 225L, 153L, 124L, 53L, 90L, 64L, 86L, 35L, 121L, 118L,
129L, 39L, 3L, 16L, 24L, 224L, 128L, 145L, 108L, 124L, 32L, 9L,
7L, 22L, 16L, 207L, 51L, 27L, 22L, 6L, 132L, 154L, 26L, 223L,
145L, 105L, 78L, 44L, 171L, 29L, 53L, 229L, 89L, 47L, 41L, 81L,
62L, 169L, 102L, 241L, 35L, 6L, 174L, 51L, 181L, 83L, 52L, 92L,
31L, 110L, 148L, 52L, 7L, 73L, 136L, 25L, 29L, 42L, 84L, 190L,
49L, 139L, 62L, 7L, 86L, 13L, 182L, 203L, 68L, 127L, 13L, 27L,
244L, 69L, 65L, 92L, 14L, 257L, 7L, 49L, 20L, 44L, 17L, 13L,
73L, 20L, 43L, 33L, 242L, 4L, 66L, 70L, 99L, 193L, 12L, 179L,
63L, 14L, 53L, 49L, 105L, 59L, 113L, 79L, 124L, 35L, 9L, 7L,
44L, 6L, 21L, 8L, 114L, 36L, 90L, 121L, 113L, 96L, 26L, 253L,
14L, 53L, 10L, 25L, 18L, 18L, 10L, 87L, 4L, 159L, 179L, 17L,
9L, 222L, 68L, 268L, 120L, 197L, 21L, 67L, 59L, 250L, 221L, 233L,
41L, 114L, 20L, 136L, 136L, 94L, 19L, 29L, 11L, 81L, 179L, 154L,
20L, 29L, 148L, 249L, 34L, 246L, 212L, 46L, 4L, 33L, 118L, 47L,
246L, 116L, 42L, 91L, 60L, 49L, 186L, 37L, 85L, 8L, 26L, 5L,
30L, 44L, 22L, 28L, 48L, 144L, 200L, 33L, 29L, 77L, 15L, 120L,
33L, 27L, 53L, 126L, 183L, 79L, 62L, 102L, 61L, 112L, 56L, 77L,
201L, 74L, 7L, 99L, 120L, 110L, 148L, 35L, 48L, 18L, 4L, 16L,
84L, 53L, 39L, 20L, 36L, 159L, 30L, 3L, 46L, 247L, 31L, 127L,
61L, 127L, 238L, 109L, 154L, 178L, 78L, 31L, 5L, 77L, 69L, 3L,
49L, 165L, 91L, 29L, 72L, 24L, 30L, 105L, 55L, 225L, 28L, 36L,
13L, 18L, 106L, 56L, 143L, 105L, 55L, 33L, 4L, 100L, 215L, 59L,
169L, 103L, 70L, 76L, 189L, 42L, 94L, 101L, 41L, 83L, 52L, 231L,
120L, 111L, 37L, 198L, 69L, 57L, 51L, 13L, 14L, 55L, 24L, 74L,
136L, 1L, 218L, 110L, 125L, 26L, 106L, 203L, 46L, 57L, 16L, 90L,
186L, 209L, 64L, 254L, 1L, 103L, 175L, 3L, 5L, 41L, 51L, 232L,
89L, 73L, 67L, 260L, 85L, 189L, 249L, 166L, 72L, 250L, 56L, 2L,
66L, 232L, 33L, 259L, 12L, 47L, 7L, 106L, 193L, 63L, 132L, 3L,
21L, 76L, 195L, 15L, 43L, 171L, 29L, 108L, 84L, 199L, 189L, 98L,
43L, 83L, 28L, 67L, 47L, 195L, 62L, 57L, 53L, 163L, 48L, 65L,
188L, 3L, 52L, 257L, 62L, 62L, 114L, 38L, 128L, 26L, 205L, 100L,
75L, 104L, 56L, 146L, 105L, 35L, 26L, 18L, 46L, 25L, 96L, 61L,
1L, 91L, 13L, 169L, 35L, 54L, 77L, 35L, 9L, 213L, 124L, 22L,
29L, 52L, 203L, 98L, 61L, 8L, 33L, 14L, 11L, 13L, 48L, 105L,
76L, 22L, 136L, 123L, 18L, 39L, 39L, 9L, 212L, 11L, 37L, 9L,
59L, 254L, 18L, 85L, 38L, 180L, 159L, 94L, 42L, 15L, 230L, 38L,
35L, 19L, 98L, 185L, 10L, 24L, 103L, 67L, 8L, 63L, 200L, 135L,
34L, 39L, 19L, 62L, 175L, 13L, 9L, 1L, 37L, 116L, 41L, 42L, 105L,
54L, 17L, 90L, 47L, 38L, 34L, 23L, 105L, 23L, 57L, 115L, 107L,
58L, 50L, 121L, 123L, 23L, 99L, 31L, 148L, 9L, 106L, 4L, 76L,
55L, 102L, 66L, 135L, 43L, 73L, 7L, 255L, 15L, 24L, 229L, 115L,
55L, 52L, 18L, 22L, 39L, 181L, 1L, 135L, 45L, 103L, 24L, 180L,
118L, 228L, 219L, 116L, 90L, 154L, 35L, 73L, 65L, 48L, 58L, 35L,
26L, 166L, 66L, 128L, 15L, 28L, 109L, 154L, 3L, 24L, 52L, 89L,
50L, 53L, 69L, 17L, 15L, 124L, 50L, 134L, 267L, 11L, 194L, 6L,
143L, 40L, 35L, 223L, 12L, 27L, 45L, 181L, 60L, 37L, 19L, 6L,
24L, 57L, 75L, 12L, 93L, 38L, 27L, 140L, 32L, 57L, 115L, 82L,
262L, 5L, 185L, 223L, 10L, 72L, 7L, 110L, 12L, 81L, 61L, 29L,
91L, 12L, 85L, 62L, 34L, 73L, 27L, 16L, 85L, 216L, 228L, 157L,
66L, 73L, 38L, 88L, 26L, 83L, 184L, 10L, 108L, 43L, 11L, 3L,
47L, 61L, 139L, 10L, 8L, 69L, 11L, 63L, 224L, 82L, 5L, 22L, 3L,
51L, 39L, 5L, 232L, 150L, 93L, 89L, 174L, 5L, 85L, 159L, 49L,
150L, 187L, 101L, 29L, 20L, 48L, 4L, 142L, 44L, 57L, 105L, 79L,
51L, 91L, 89L, 115L, 14L, 67L, 2L, 165L, 114L, 2L, 17L, 67L,
38L, 108L, 23L, 103L, 223L, 1L, 34L, 21L, 41L, 73L, 186L, 55L,
14L, 61L, 81L, 75L, 15L, 95L, 85L, 145L, 222L, 139L, 231L, 162L,
79L, 67L, 80L, 75L, 17L, 27L, 48L, 38L, 27L, 71L, 100L, 51L,
132L, 2L, 183L, 110L, 23L, 37L, 103L, 30L, 43L, 138L, 1L, 13L,
83L, 180L, 27L, 21L, 236L, 78L, 118L, 93L, 95L, 83L, 28L, 15L,
236L, 41L, 51L, 11L, 181L, 91L, 4L, 40L, 86L, 165L, 24L, 115L,
252L, 28L, 35L, 13L, 15L, 7L, 9L, 27L, 33L, 9L, 40L, 5L, 105L,
28L, 5L, 16L, 117L, 153L, 27L, 141L, 52L, 168L, 10L, 84L, 17L,
47L, 56L, 233L, 140L, 69L, 221L, 19L, 8L, 71L, 37L, 123L, 137L,
10L, 55L, 146L, 14L, 41L, 69L, 142L, 89L, 4L, 37L, 170L, 37L,
35L, 182L, 70L, 24L, 158L, 83L, 25L, 38L, 116L, 132L, 209L, 69L,
221L, 41L, 114L, 28L, 20L, 42L, 132L, 83L, 168L, 87L, 64L, 249L,
155L, 66L, 113L, 44L, 35L, 100L, 133L, 31L, 126L, 10L, 184L,
53L, 64L, 57L, 22L, 2L, 30L, 25L, 39L, 151L, 164L, 42L, 72L,
2L, 38L, 29L, 8L, 22L, 9L, 91L, 58L, 58L, 78L, 82L, 117L, 104L,
29L, 80L, 70L, 137L, 137L, 115L, 10L, 87L, 66L, 1L, 11L, 21L,
118L, 262L, 70L, 5L, 153L, 118L, 35L, 249L, 68L, 38L, 79L, 30L,
39L, 39L, 158L, 17L, 145L, 5L, 8L, 47L, 177L, 77L, 203L, 94L,
107L, 96L, 68L, 7L, 12L, 24L, 18L, 146L, 13L, 164L, 54L, 73L,
143L, 96L, 22L, 5L, 100L, 71L, 65L, 1L, 16L, 22L, 13L, 39L, 101L,
39L, 75L, 148L, 45L, 257L, 67L, 18L, 50L, 62L, 29L, 222L, 96L,
7L, 7L, 130L, 108L, 44L, 48L, 109L, 67L, 112L, 100L, 169L, 260L,
130L, 169L, 79L, 111L, 121L, 15L, 21L, 240L, 220L, 56L, 8L, 18L,
4L, 37L, 98L, 46L, 247L, 66L, 69L, 19L, 66L, 112L, 42L, 103L,
122L, 155L, 36L, 4L, 60L, 39L, 25L, 2L, 182L, 105L, 157L, 5L,
70L, 16L, 55L, 52L, 39L, 156L, 14L, 118L, 88L, 91L, 132L, 52L,
18L, 38L, 31L, 35L, 75L, 186L, 45L, 110L, 232L, 52L, 135L, 33L,
11L, 29L, 129L, 147L, 20L, 20L, 59L, 46L, 6L, 53L, 251L, 120L,
192L, 41L, 87L, 38L, 134L, 5L, 120L, 130L, 71L, 121L, 84L, 183L,
166L, 20L, 8L, 20L, 74L, 201L, 35L, 176L, 189L, 17L, 231L, 48L,
38L, 3L, 142L, 53L, 199L, 135L, 6L, 38L, 256L, 76L, 6L, 56L,
154L, 25L, 76L, 69L, 149L, 107L, 113L, 246L, 61L, 23L, 6L, 76L,
3L, 68L, 70L, 89L, 130L, 226L, 31L, 157L, 24L, 80L, 170L, 169L,
64L, 12L, 110L, 47L, 141L, 159L, 22L, 53L, 167L, 61L, 81L, 98L,
172L, 261L, 99L, 9L, 13L, 132L, 103L, 16L, 97L, 186L, 35L, 128L,
73L, 136L, 62L, 187L, 30L, 31L, 26L, 115L, 76L, 260L, 54L, 11L,
169L, 227L, 43L, 6L, 23L, 212L, 23L, 68L, 119L, 181L, 34L, 137L,
144L, 48L, 101L, 25L, 10L, 92L, 5L, 92L, 132L, 206L, 44L, 113L,
9L, 25L, 249L, 69L, 250L, 67L, 35L, 6L, 60L, 251L, 6L, 32L, 94L,
13L, 224L, 21L, 43L, 81L, 9L, 9L, 95L, 11L, 7L, 26L, 172L, 46L,
17L, 3L, 2L, 39L, 26L, 7L, 18L, 57L, 88L, 16L, 47L, 136L, 135L,
73L, 26L, 60L, 56L, 77L, 158L, 23L, 1L, 139L, 234L, 76L, 99L,
28L, 22L, 83L, 114L, 6L, 122L, 7L, 36L, 59L, 4L, 33L, 79L, 25L,
26L, 8L, 28L, 19L, 33L, 2L, 23L, 44L, 158L, 56L, 14L, 8L, 56L,
16L, 36L, 90L, 18L, 22L, 7L, 74L, 70L, 2L, 51L, 13L, 130L, 25L,
17L, 23L, 48L, 37L, 60L, 17L, 58L, 15L, 41L, 261L, 245L, 35L,
17L, 41L, 234L, 13L, 11L, 192L, 3L, 5L, 29L, 14L, 34L, 4L, 110L,
63L, 47L, 157L, 9L, 116L, 120L, 29L, 126L, 26L, 106L, 219L, 209L,
93L, 255L, 137L, 88L, 96L, 87L, 229L, 23L, 128L, 101L, 62L, 2L,
193L, 58L, 1L, 8L, 146L, 44L, 12L, 27L, 99L, 270L, 54L, 41L,
161L, 231L, 53L, 126L, 139L, 77L, 55L, 32L, 6L, 159L, 131L, 54L,
266L, 87L, 13L, 205L, 154L, 3L, 82L, 35L, 11L, 2L, 56L, 84L,
110L, 116L, 28L, 30L, 60L, 74L, 12L, 147L, 31L, 206L, 31L, 56L,
209L, 115L, 149L, 33L, 198L, 205L, 71L, 28L, 40L, 201L, 32L,
3L, 40L, 75L, 91L, 32L, 9L, 4L, 192L, 11L, 41L, 30L, 46L, 57L,
44L, 243L, 67L, 118L, 108L, 181L, 83L, 45L, 93L, 13L, 2L, 104L,
163L, 92L, 8L, 17L, 14L, 150L, 5L, 60L, 123L, 100L, 105L, 110L,
225L, 249L, 207L, 100L, 188L, 138L, 6L, 176L, 68L, 91L, 8L, 20L,
18L, 21L, 79L, 20L, 4L, 99L, 136L, 28L, 156L, 7L, 36L, 226L,
33L, 42L, 1L, 28L, 227L, 11L, 9L, 157L, 206L, 34L, 17L, 61L,
113L, 112L, 158L, 24L, 18L, 36L, 75L, 40L, 18L, 183L, 3L, 37L,
92L, 69L, 13L, 213L, 48L, 163L, 188L, 251L, 59L, 75L, 1L, 12L,
46L, 232L, 13L, 74L, 32L, 149L, 219L, 22L, 59L, 109L, 264L, 25L,
141L, 5L, 67L, 41L, 5L, 71L, 19L, 63L, 114L, 28L, 76L, 80L, 86L,
71L, 18L, 166L, 40L, 57L, 185L, 88L, 115L)
The problem is that you initially created 4000 * 3 data.frame filled in with NA. Please see the corrected code. I did not put your actual data vec1 (too long) and simulated vec1 with sampling from exponential distribution. Additionally I used colMeans as more effective than apply. See the code below:
# vec1, mydata, l - simulation
set.seed(123)
vec1 <- (sample(1:271, 4000, replace = TRUE, prob = dexp(1:271, rate = .01)))
mydata <- matrix(1:(300 * 300), nrow = 300)
l <- 300
# data given by OP
df <- data.frame(Age = 1, Weight = 1, height = 1 )
df <- df[-1, ]
i <- 1
j <- vec1[1] - 1
k <- 0
repeat{
elements <- as.vector(colMeans(mydata[i:(j + 1), 3:5]))
df <- rbind(df, elements)
k <- k + 1
i = i + vec1[k]
j = j + vec1[k + 1]
if (j + 1 >= l){
break
}
}
df <- setNames(df, c("Age","Weight", "height"))
df
Output:
Age Weight height
1 608.0 908.0 1208.0
2 638.0 938.0 1238.0
3 716.0 1016.0 1316.0
4 787.5 1087.5 1387.5
5 816.0 1116.0 1416.0
6 835.0 1135.0 1435.0
I have the following piece of my data-set:
> dput(test)
structure(list(X2002.06.26 = structure(c(99L, 88L, 65L, 94L,
60L, 101L, 27L, 83L, 16L, 12L, 54L, 97L, 63L, 41L, 13L, 2L, 58L,
9L, 82L, 22L, 14L, 77L, 55L, 32L, 45L, 80L, 39L, 70L, 114L, 103L,
69L, 104L, 106L, 108L, 38L, 10L, 64L, 1L, 112L, 102L, 67L, 98L,
66L, 19L, 81L, 72L, 89L, 23L, 48L, 4L, 25L, 91L, 26L, 62L, 33L,
3L, 28L, 57L, 17L, 20L, 73L, 78L, 90L, 84L, 5L, 92L, 43L, 74L,
75L, 93L, 100L, 56L, 36L, 79L, 111L, 52L, 24L, 105L, 29L, 53L,
110L, 71L, 18L, 8L, 34L, 50L, 109L, 61L, 35L, 21L, 11L, 47L,
59L, 51L, 113L, 44L, 30L, 42L, 107L, 7L, 87L, 6L, 68L, 96L, 86L,
15L, 46L, 85L, 31L, 49L, 40L, 76L, 95L, 115L, 37L), .Label = c("BMG4388N1065",
"BMG812761002", "GB00BYMT0J19", "IE00BLS09M33", "IE00BQRQXQ92",
"US0003611052", "US0015471081", "US0025671050", "US0028962076",
"US0044981019", "US0116591092", "US01741R1023", "US0185223007",
"US01988P1084", "US0305061097", "US0311001004", "US03662Q1058",
"US0375981091", "US0383361039", "US03836W1036", "US03937C1053",
"US0396701049", "US0462241011", "US06652V2088", "US0997241064",
"US1033041013", "US1096961040", "US1170431092", "US1250711009",
"US1258961002", "US12686C1099", "US1311931042", "US1416651099",
"US1423391002", "US1431301027", "US1564311082", "US1718711062",
"US1778351056", "US2193501051", "US2289031005", "US23331A1097",
"US2537981027", "US2829141009", "US2925621052", "US2966891028",
"US3116421021", "US34354P1057", "US3498531017", "US3693851095",
"US3984331021", "US3989051095", "US4158641070", "US4222451001",
"US4285671016", "US4586653044", "US4835481031", "US5261071071",
"US5367971034", "US5463471053", "US55305B1017", "US5535301064",
"US5562691080", "US5663301068", "US5871181005", "US59001A1025",
"US6081901042", "US62914B1008", "US6517185046", "US6900701078",
"US6907684038", "US6936561009", "US7081601061", "US7132781094",
"US7234561097", "US7310681025", "US7415034039", "US7496851038",
"US7549071030", "US7595091023", "US76009N1000", "US7703231032",
"US7811821005", "US7835491082", "US8081941044", "US8308791024",
"US83088M1027", "US83545G1022", "US8354951027", "US8528572006",
"US8545021011", "US85590A4013", "US8581191009", "US8589121081",
"US8681571084", "US8685361037", "US8712371033", "US8793691069",
"US8799391060", "US8832031012", "US8851601018", "US8865471085",
"US8873891043", "US88830M1027", "US8968181011", "US89785X1019",
"US8990355054", "US90385D1072", "US9134831034", "US9202531011",
"US92552R4065", "US9410531001", "US9427491025", "US9433151019",
"US9633201069", "US9837721045"), class = "factor"), X2002.06.27 = structure(c(57L,
43L, 73L, 70L, 35L, 114L, 58L, 88L, 55L, 7L, 72L, 28L, 16L, 84L,
110L, 44L, 75L, 20L, 99L, 18L, 10L, 80L, 113L, 52L, 66L, 36L,
60L, 101L, 107L, 103L, 34L, 22L, 81L, 40L, 1L, 46L, 108L, 106L,
91L, 37L, 98L, 9L, 104L, 115L, 54L, 100L, 42L, 2L, 3L, 26L, 21L,
71L, 23L, 62L, 50L, 97L, 11L, 94L, 27L, 53L, 79L, 4L, 51L, 76L,
49L, 78L, 87L, 32L, 59L, 96L, 13L, 86L, 15L, 48L, 109L, 29L,
85L, 68L, 17L, 41L, 64L, 31L, 8L, 38L, 90L, 45L, 12L, 56L, 6L,
39L, 92L, 63L, 5L, 82L, 19L, 89L, 69L, 74L, 25L, 95L, 105L, 61L,
67L, 14L, 112L, 111L, 102L, 83L, 93L, 33L, 30L, 47L, 65L, 24L,
77L), .Label = c("CH0044328745", "GB00BVVBC028", "LR0008862868",
"US0003611052", "US0010841023", "US0044981019", "US0079731008",
"US0116591092", "US0305061097", "US0311001004", "US0383361039",
"US03937C1053", "US0462241011", "US06652V2088", "US0733021010",
"US0952291005", "US0997241064", "US1096411004", "US1096961040",
"US1265011056", "US12686C1099", "US1311931042", "US1431301027",
"US1564311082", "US1628251035", "US1630721017", "US1897541041",
"US2017231034", "US23331A1097", "US2829141009", "US2925621052",
"US29444U7000", "US2974251009", "US3024913036", "US3138551086",
"US34354P1057", "US3596941068", "US3693851095", "US3719011096",
"US3825501014", "US3984331021", "US3989051095", "US4108671052",
"US4130861093", "US4158641070", "US4456581077", "US4586653044",
"US4606901001", "US48666K1097", "US5006432000", "US5053361078",
"US5138471033", "US5179421087", "US5246601075", "US5260571048",
"US5463471053", "US5526761086", "US5535301064", "US5663301068",
"US5766901012", "US59001A1025", "US6117421072", "US63935N1072",
"US6515871076", "US67066G1040", "US6795801009", "US6819191064",
"US6900701078", "US6907684038", "US6935061076", "US6936561009",
"US6951561090", "US7004162092", "US73179P1066", "US7376301039",
"US7401891053", "US74762E1029", "US7496851038", "US7549071030",
"US7757111049", "US7811821005", "US8305661055", "US8308791024",
"US8335511049", "US83545G1022", "US8354951027", "US8358981079",
"US8545021011", "US85590A4013", "US86732Y1091", "US8681681057",
"US8712371033", "US87305R1095", "US8799391060", "US8851601018",
"US88830M1027", "US8894781033", "US8962391004", "US8968181011",
"US89785X1019", "US9022521051", "US90385D1072", "US9046772003",
"US9111631035", "US9134831034", "US92552R4065", "US92552V1008",
"US9258151029", "US9292361071", "US9410531001", "US9427491025",
"US9433151019", "US9699041011", "US9746371007", "US9807451037"
), class = "factor")), .Names = c("X2002.06.26", "X2002.06.27"
), class = "data.frame", row.names = c(NA, -115L))
The actual data extends over 3000+ columns and there are approximately 1150 unique values.
I need to count how many times each of these values appears in the Data-Set.
We can try to flat the elements in the data frame first, then apply the table() method:
tab1 <- table(do.call(c, lapply(df, as.character)))
Another option is to convert the data frame to matrix then apply table method:
tab2 <- table(as.matrix(df))
identical(tab1, tab2)
[1] TRUE