Average/Max across teams as one data point

Hi there,

Beginner here. I am trying to create a plot where each point represents a "Team". Each team has multiple "Players," each with their own data point. For the sake of this question, my axes are Skill and Maps. I would like each team to have its own data point, where the location of the point corresponds to the average of the Skill data points and the maximum of the Maps data points. Is this possible? If so, what could I use to create this? Any help appreciated!

Can you supply some sample data? A handy way to supply some sample data is the dput() function. In the case of a large dataset something like dput(head(mydata, 100)) should supply the data we need.

structure(list(Country = c("South Korea", "South Korea", "South Korea",
"South Korea", "South Korea", "South Korea", "South Korea", "South Korea",
"South Korea", "South Korea", "Brazil", "Brazil", "Brazil", "Brazil",
"Argentina", "Turkey", "Poland", "Poland", "Spain", "Finland",
"United States", "United States", "United States", "South Korea",
"United States", "Finland", "France", "Finland", "Croatia", "Czechia",
"United Kingdom", "United Kingdom", "Thailand", "Thailand", "Thailand",
"Thailand", "Thailand", "Brazil", "Brazil", "Brazil", "Brazil",
"Brazil", "United States", "Canada", "Canada", "United States",
"Singapore", "Singapore", "Indonesia", "Malaysia", "Indonesia",
"Singapore", "Canada", "United States", "United States", "United States",
"United States", "South Korea", "Canada", "United States", "United States",
"United States", "Thailand", "Thailand", "Thailand", "Thailand",
"Thailand", "Finland", "Sweden", "France", "Spain", "Lithuania",
"Spain", "Denmark", "Brazil", "Brazil", "Brazil", "Brazil", "Brazil",
"Brazil", "United States", "United States", "United States",
"United States", "Canada", "United Kingdom", "Belgium", "Belgium",
"Finland", "United Kingdom", "United Kingdom", "Philippines",
"Philippines", "Philippines", "Philippines", "Philippines", "Chile",
"Argentina", "Chile", "Chile"), Player = c("Zest", "BuZz", "MaKo",
"Rb", "Stax", "Bunny", "Esperanza", "Zunba", "FiveK", "Efina",
"Aspas", "Sacy", "Less", "PANcada", "Saadhak", "Cned", "Zeek",
"Starxo", "Kiles", "BONECOLD", "Leaf", "Xeppaa", "Mitch", "Xeta",
"Vanity", "H1ber", "Enzo", "Derke", "Doma", "Magnum", "Mistic",
"Boaster", "Surf", "Foxz", "Crws", "Sushiboys", "SScary", "Krain",
"Shion", "Pleets", "Liazzi", "Myssen", "Zellsis", "Penny", "Effys",
"Jammyz", "Shiba", "Jinggg", "F0rsakeN", "D4v41", "Mindfreak",
"Benkai", "TenZ", "ShahZaM", "SicK", "Dapr", "Zombs", "Sayaplayer",
"JonahP", "Nats", "Valyn", "Trent", "LAMMYSNAX", "JohnOlsen",
"SuperBusS", "PTC", "ChAlalala", "Hoody", "Meddo", "Keloqz",
"Koldamenta", "Nukkye", "Mixwell", "AvovA", "Mwzera", "Ntk",
"Heat", "Murizzz", "V1xen", "JhoW", "Asuna", "Ethan", "Nitr0",
"Hiko", "Steel", "Kryptix", "Nivera", "ScreaM", "Jamppi", "L1NK",
"Soulcas", "DubsteP", "Dispenser", "Witz", "JessieVash", "BORKUM",
"Keznit", "Klaus", "Mazino", "NagZ"), Team = c("DRX", "DRX",
"DRX", "DRX", "DRX", "F4Q", "F4Q", "F4Q", "F4Q", "F4Q", "LOUD",
"LOUD", "LOUD", "LOUD", "LOUD", "Acend", "Acend", "Acend", "Acend",
"Acend", "Cloud9", "Cloud9", "Cloud9", "Cloud9", "Cloud9", "Fnatic",
"Fnatic", "Fnatic", "Fnatic", "Fnatic", "Fnatic", "Fnatic", "Xerxia",
"Xerxia", "Xerxia", "Xerxia", "Xerxia", "Liberty", "Liberty",
"Liberty", "Liberty", "Liberty", "Version1", "Version1", "Version1",
"Version1", "Paper Rex", "Paper Rex", "Paper Rex", "Paper Rex",
"Paper Rex", "Paper Rex", "Sentinels", "Sentinels", "Sentinels",
"Sentinels", "Sentinels", "The Guard", "The Guard", "The Guard",
"The Guard", "The Guard", "FULL SENSE", "FULL SENSE", "FULL SENSE",
"FULL SENSE", "FULL SENSE", "G2 Esports", "G2 Esports", "G2 Esports",
"G2 Esports", "G2 Esports", "G2 Esports", "G2 Esports", "Keyd Stars",
"Keyd Stars", "Keyd Stars", "Keyd Stars", "Keyd Stars", "Keyd Stars",
"100 Thieves", "100 Thieves", "100 Thieves", "100 Thieves", "100 Thieves",
"Team Liquid", "Team Liquid", "Team Liquid", "Team Liquid", "Team Liquid",
"Team Liquid", "Team Secret", "Team Secret", "Team Secret", "Team Secret",
"Team Secret", "KRÜ Esports", "KRÜ Esports", "KRÜ Esports",
"KRÜ Esports"), Region = c("Korea", "Korea", "Korea", "Korea",
"Korea", "Korea", "Korea", "Korea", "Korea", "Korea", "Brazil",
"Brazil", "Brazil", "Brazil", "Brazil", "Europe", "Europe", "Europe",
"Europe", "Europe", "North America", "North America", "North America",
"North America", "North America", "Europe", "Europe", "Europe",
"Europe", "Europe", "Europe", "Europe", "Asia Pacific", "Asia Pacific",
"Asia Pacific", "Asia Pacific", "Asia Pacific", "Brazil", "Brazil",
"Brazil", "Brazil", "Brazil", "North America", "North America",
"North America", "North America", "Asia Pacific", "Asia Pacific",
"Asia Pacific", "Asia Pacific", "Asia Pacific", "Asia Pacific",
"North America", "North America", "North America", "North America",
"North America", "North America", "North America", "North America",
"North America", "North America", "Asia Pacific", "Asia Pacific",
"Asia Pacific", "Asia Pacific", "Asia Pacific", "Europe", "Europe",
"Europe", "Europe", "Europe", "Europe", "Europe", "Brazil", "Brazil",
"Brazil", "Brazil", "Brazil", "Brazil", "North America", "North America",
"North America", "North America", "North America", "Europe",
"Europe", "Europe", "Europe", "Europe", "Europe", "Asia Pacific",
"Asia Pacific", "Asia Pacific", "Asia Pacific", "Asia Pacific",
"LATAM", "LATAM", "LATAM", "LATAM"), Maps = c(13, 28, 28, 28,
28, 10, 10, 10, 10, 10, 11, 11, 11, 11, 24, 24, 24, 24, 24, 24,
10, 10, 10, 10, 20, 4, 4, 25, 25, 29, 29, 29, 7, 23, 23, 23,
23, 4, 4, 4, 4, 4, 10, 10, 10, 10, 5, 10, 15, 15, 15, 15, 30,
30, 30, 30, 30, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 6, 6, 14, 14, 20,
20, 20, 5, 6, 11, 11, 11, 11, 10, 10, 10, 10, 10, 9, 20, 29,
29, 29, 29, 9, 9, 9, 9, 9, 27, 33, 33, 33), K = c(194, 468, 439,
375, 426, 144, 125, 120, 105, 97, 211, 169, 166, 165, 330, 435,
389, 344, 289, 291, 210, 154, 152, 153, 285, 63, 68, 498, 398,
461, 408, 396, 121, 349, 300, 354, 329, 50, 54, 46, 48, 40, 184,
185, 161, 136, 48, 184, 268, 200, 174, 196, 587, 511, 473, 395,
366, 95, 77, 67, 67, 63, 61, 53, 52, 48, 41, 105, 69, 261, 170,
301, 270, 256, 61, 81, 214, 160, 130, 120, 171, 159, 161, 128,
120, 104, 311, 551, 483, 417, 403, 141, 132, 117, 101, 103, 490,
438, 464, 469), D = c(171, 419, 361, 395, 380, 146, 148, 144,
155, 139, 168, 159, 164, 172, 382, 345, 334, 344, 353, 342, 176,
174, 156, 151, 337, 73, 61, 416, 372, 444, 404, 442, 120, 369,
367, 352, 338, 63, 69, 62, 61, 61, 168, 173, 146, 169, 77, 168,
246, 230, 229, 205, 448, 429, 435, 435, 421, 75, 80, 77, 78,
79, 65, 68, 61, 62, 58, 97, 91, 197, 179, 276, 284, 274, 67,
93, 163, 164, 146, 159, 162, 148, 128, 124, 152, 117, 272, 438,
438, 401, 423, 123, 112, 115, 120, 105, 451, 489, 518, 496),
A = c(64, 114, 230, 151, 187, 33, 48, 51, 45, 22, 35, 72,
61, 58, 168, 99, 154, 148, 127, 146, 58, 77, 42, 87, 160,
22, 19, 119, 199, 131, 215, 178, 16, 131, 157, 95, 176, 19,
7, 24, 8, 18, 61, 40, 69, 56, 31, 51, 47, 99, 105, 67, 140,
167, 189, 183, 224, 15, 20, 14, 43, 19, 20, 16, 18, 26, 9,
38, 15, 28, 95, 121, 100, 112, 21, 32, 25, 54, 72, 67, 39,
50, 62, 65, 57, 54, 71, 162, 113, 176, 217, 18, 42, 43, 64,
41, 129, 171, 218, 108), KD = c(1.13, 1.12, 1.22, 0.95, 1.12,
0.99, 0.84, 0.83, 0.68, 0.7, 1.26, 1.06, 1.01, 0.96, 0.86,
1.26, 1.16, 1, 0.82, 0.85, 1.19, 0.89, 0.97, 1.01, 0.85,
0.86, 1.11, 1.2, 1.07, 1.04, 1.01, 0.9, 1.01, 0.95, 0.82,
1.01, 0.97, 0.79, 0.78, 0.74, 0.79, 0.66, 1.1, 1.07, 1.1,
0.8, 0.62, 1.1, 1.09, 0.87, 0.76, 0.96, 1.31, 1.19, 1.09,
0.91, 0.87, 1.27, 0.96, 0.87, 0.86, 0.8, 0.94, 0.78, 0.85,
0.77, 0.71, 1.08, 0.76, 1.32, 0.95, 1.09, 0.95, 0.93, 0.91,
0.87, 1.31, 0.98, 0.89, 0.75, 1.06, 1.07, 1.26, 1.03, 0.79,
0.89, 1.14, 1.26, 1.1, 1.04, 0.95, 1.15, 1.18, 1.02, 0.84,
0.98, 1.09, 0.9, 0.9, 0.95), KDA = c(1.51, 1.39, 1.85, 1.33,
1.61, 1.21, 1.17, 1.19, 0.97, 0.86, 1.46, 1.52, 1.38, 1.3,
1.3, 1.55, 1.63, 1.43, 1.18, 1.28, 1.52, 1.33, 1.24, 1.59,
1.32, 1.16, 1.43, 1.48, 1.6, 1.33, 1.54, 1.3, 1.14, 1.3,
1.25, 1.28, 1.49, 1.1, 0.88, 1.13, 0.92, 0.95, 1.46, 1.3,
1.58, 1.14, 1.03, 1.4, 1.28, 1.3, 1.22, 1.28, 1.62, 1.58,
1.52, 1.33, 1.4, 1.47, 1.21, 1.05, 1.41, 1.04, 1.25, 1.01,
1.15, 1.19, 0.86, 1.47, 0.92, 1.47, 1.48, 1.53, 1.3, 1.34,
1.22, 1.22, 1.47, 1.3, 1.38, 1.18, 1.3, 1.41, 1.74, 1.56,
1.16, 1.35, 1.4, 1.63, 1.36, 1.48, 1.47, 1.29, 1.55, 1.39,
1.38, 1.37, 1.37, 1.25, 1.32, 1.16), ACS_Map = c(196, 230.25,
220.25, 181.5, 195.75, 228, 191, 173, 159, 155, 249, 202,
202, 180, 185.75, 246, 224.5, 188.5, 158.5, 160.5, 263, 195,
184, 179, 178.5, 231, 229, 204, 152.25, 167.375, 159.125,
131.75, 212, 195.75, 169.25, 192.75, 187.5, 205, 193, 181,
180, 156, 230, 227, 186, 176, 128, 250, 234.5, 185, 155,
166, 252, 226, 211, 184.5, 158.5, 251, 198, 179, 178, 162,
213, 192, 179, 168, 139, 242, 152, 257, 177, 221.5, 199.5,
172.5, 188, 178, 263.5, 201.5, 151, 157, 247, 212, 202, 187,
174, 161, 197.5, 259, 219.5, 181.75, 193.25, 237, 212, 204,
201, 165, 191.875, 185.625, 184.5, 190), K_Map = c(14.92,
16.71, 15.68, 13.39, 15.21, 14.4, 12.5, 12, 10.5, 9.7, 19.18,
15.36, 15.09, 15, 13.75, 18.13, 16.21, 14.33, 12.04, 12.13,
21, 15.4, 15.2, 15.3, 14.25, 15.75, 17, 19.92, 15.92, 15.9,
14.07, 13.66, 17.29, 15.17, 13.04, 15.39, 14.3, 12.5, 13.5,
11.5, 12, 10, 18.4, 18.5, 16.1, 13.6, 9.6, 18.4, 17.87, 13.33,
11.6, 13.07, 19.57, 17.03, 15.77, 13.17, 12.2, 19, 15.4,
13.4, 13.4, 12.6, 15.25, 13.25, 13, 12, 10.25, 17.5, 11.5,
18.64, 12.14, 15.05, 13.5, 12.8, 12.2, 13.5, 19.45, 14.55,
11.82, 10.91, 17.1, 15.9, 16.1, 12.8, 12, 11.56, 15.55, 19,
16.66, 14.38, 13.9, 15.67, 14.67, 13, 11.22, 11.44, 18.15,
13.27, 14.06, 14.21), D_Map = c(13.15, 14.96, 12.89, 14.11,
13.57, 14.6, 14.8, 14.4, 15.5, 13.9, 15.27, 14.45, 14.91,
15.64, 15.92, 14.38, 13.92, 14.33, 14.71, 14.25, 17.6, 17.4,
15.6, 15.1, 16.85, 18.25, 15.25, 16.64, 14.88, 15.31, 13.93,
15.24, 17.14, 16.04, 15.96, 15.3, 14.7, 15.75, 17.25, 15.5,
15.25, 15.25, 16.8, 17.3, 14.6, 16.9, 15.4, 16.8, 16.4, 15.33,
15.27, 13.67, 14.93, 14.3, 14.5, 14.5, 14.03, 15, 16, 15.4,
15.6, 15.8, 16.25, 17, 15.25, 15.5, 14.5, 16.17, 15.17, 14.07,
12.79, 13.8, 14.2, 13.7, 13.4, 15.5, 14.82, 14.91, 13.27,
14.45, 16.2, 14.8, 12.8, 12.4, 15.2, 13, 13.6, 15.1, 15.1,
13.83, 14.59, 13.67, 12.44, 12.78, 13.33, 11.67, 16.7, 14.82,
15.7, 15.03), A_Map = c(4.92, 4.07, 8.21, 5.39, 6.68, 3.3,
4.8, 5.1, 4.5, 2.2, 3.18, 6.55, 5.55, 5.27, 7, 4.13, 6.42,
6.17, 5.29, 6.08, 5.8, 7.7, 4.2, 8.7, 8, 5.5, 4.75, 4.76,
7.96, 4.52, 7.41, 6.14, 2.29, 5.7, 6.83, 4.13, 7.65, 4.75,
1.75, 6, 2, 4.5, 6.1, 4, 6.9, 5.6, 6.2, 5.1, 3.13, 6.6, 7,
4.47, 4.67, 5.57, 6.3, 6.1, 7.47, 3, 4, 2.8, 8.6, 3.8, 5,
4, 4.5, 6.5, 2.25, 6.33, 2.5, 2, 6.79, 6.05, 5, 5.6, 4.2,
5.33, 2.27, 4.91, 6.55, 6.09, 3.9, 5, 6.2, 6.5, 5.7, 6, 3.55,
5.59, 3.9, 6.07, 7.48, 2, 4.67, 4.78, 7.11, 4.56, 4.78, 5.18,
6.61, 3.27), Skill_Calc = c(334.4348, 358.4532, 497.10425,
229.32525, 352.9764, 273.1212, 187.7148, 170.8721, 104.8764,
93.31, 458.0604, 325.4624, 281.5476, 224.64, 207.6685, 480.438,
424.4846, 269.555, 153.3646, 174.624, 475.7144, 230.8215,
221.3152, 287.4561, 200.277, 230.4456, 363.4917, 362.304,
260.652, 231.5131, 247.503025, 154.1475, 244.0968, 241.75125,
173.48125, 249.1872, 270.99375, 178.145, 132.4752, 151.3522,
130.824, 97.812, 369.38, 315.757, 323.268, 160.512, 81.7408,
385, 327.1744, 209.235, 143.716, 203.9808, 534.7944, 424.9252,
349.5848, 223.30035, 193.053, 468.5919, 229.9968, 163.5165,
215.8428, 134.784, 250.275, 151.2576, 174.9725, 153.9384,
84.8734, 384.1992, 106.2784, 498.6828, 248.862, 369.39555,
246.3825, 214.9695, 208.7176, 188.9292, 507.42195, 256.711,
185.4582, 138.945, 340.366, 319.8444, 442.8648, 300.4716,
159.4536, 193.4415, 315.21, 531.9342, 328.372, 279.7496,
269.873625, 351.5895, 387.748, 289.2312, 232.9992, 221.529,
286.5269375, 208.828125, 219.186, 209.38)), row.names = c(NA,
-100L), class = c("tbl_df", "tbl", "data.frame"))

Does this help?

Is this what you want?

library(tidyverse)

sample_data %>% 
    group_by(Team) %>% 
    summarise(Maps = max(Maps),
              Skill = mean(K_Map)) %>% # Change this to use the correct variable
    ggplot(aes(x = Skill, y = Maps, color = Team)) +
    geom_point()

Note: It is not clear to me which column in your sample data represents Skill points so I just chose one randomly, you have to account for that.

yes thank you!!! this is exactly what I need and I see how you did it too! Thank you SO MUCH!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.