In order to help you, we need sample data on a copy/paste friendly format since it seems you are new to R, I'm going to help you to create a reprex this time, but I hope you learn from this and provide your own REPRoducible EXample (reprex) next time.
# Sample data on a copy/paste friendly format
sample_df <- data.frame(stringsAsFactors=FALSE,
ID = c(109, 18, 26, 127, 17, 53, 76, 48, 80, 146, 11, 103,
107, 4, 132, 64, 74, 151, 21, 123, 129, 135, 85,
124, 65, 148, 150, 19, 60, 3, 112, 121, 134, 1, 113,
82, 12, 59, 92, 110, 106, 33, 23, 91, 5, 117, 94, 70,
50, 55, 46, 86, 83, 10, 137, 31, 78, 13, 102, 104, 88,
32, 14, 77, 36, 73, 15, 51, 6, 45, 27, 119, 98, 63,
143, 38, 37, 118, 69, 116, 81, 120, 138, 140, 49, 72,
84, 147, 66, 128, 111, 22, 40, 145, 42, 114, 61, 96,
58, 67, 28, 8, 144, 125, 29, 16, 30, 7, 57, 24, 25,
71, 97, 149, 75, 122, 108, 56, 126, 79, 139, 90, 89,
87, 142, 62, 35, 101, 52, 34, 47, 43, 133, 20, 141,
136, 39, 44, 95, 131, 100, 130, 41, 105, 93, 54, 9, 2,
68, 99, 115),
Country = c("Afghanistan", "Albania", "Algeria", "Angola",
"Argentina", "Armenia", "Australia", "Austria",
"Azerbaijan", "Bahrain", "Bangladesh", "Belarus",
"Belgium", "Belize", "Benin", "Bolivia",
"Bosnia and Herzegovina", "Botswana", "Brazil", "Bulgaria",
"Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada",
"Central African Republic", "Chad", "Chile", "China",
"Colombia", "Comoros", "Congo", "Congo,
Dem. Rep. of the", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba",
"Cyprus", "Czech", "Denmark", "Djibouti",
"Dominican Republic", "Ecuador", "Egypt", "El Salvador",
"Estonia", "Ethiopia", "Finland", "France", "Georgia",
"Germany", "Ghana", "Greece", "Guatemala", "Guinea",
"Guyana", "Haiti", "Honduras", "Hong Kong", "Hungary",
"Iceland", "India", "Indonesia", "Iran", "Iraq",
"Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan",
"Kazakhstan", "Kenya", "Korea", "Kuwait",
"Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Liberia", "Libya",
"Lithuania", "Luxembourg", "Macedonia", "Madagascar",
"Malawi", "Malaysia", "Mali", "Malta", "Mauritania",
"Mauritius", "Mexico", "Moldova", "Mongolia",
"Morocco", "Mozambique", "Myanmar", "Namibia", "Nepal",
"Netherlands", "New Zealand", "Nicaragua", "Niger",
"Nigeria", "Norway", "Pakistan", "Palestine", "Panama",
"Paraguay", "Peru", "Philippines", "Poland",
"Portugal", "Qatar", "Romania", "Russia", "Rwanda",
"Saudi Arabia", "Senegal", "Serbia", "Sierra Leone",
"Singapore", "Slovakia", "Slovenia", "South Africa", "Spain",
"Sri Lanka", "Sudan", "Sweden", "Switzerland",
"Syria", "Tajikistan", "Tanzania", "Thailand", "Togo",
"Trinidad and Tobago", "Tunisia", "Turkey",
"Turkmenistan", "Uganda", "Ukraine", "United Arab Emirates",
"United Kingdom", "United States of America", "Uruguay",
"Uzbekistan", "Venezuela", "Vietnam", "Yemen",
"Zambia", "Zimbabwe"),
Continent = c("Asia", "Europe", "Africa", "Africa",
"South America", "Europe", "Ocenia", "Europe",
"Europe", "Asia", "Asia", "Europe", "Europe", "Europe",
"Africa", "South America", "Europe", "Africa",
"South America", "Europe", "Africa", "Africa", "Asia",
"Africa", "North America", "Africa", "Africa",
"South America", "Asia", "South America", "Africa", "Africa",
"Africa", "South America", "Africa", "Europe",
"South America", "Europe", "Republic Europe", "Europe",
"Africa", "South America", "South America", "Africa",
"South America", "Europe", "Africa", "Europe", "Europe",
"Europe", "Europe", "Africa", "Europe",
"South America", "Africa", "South America", "North America",
"South America", "Asia", "Europe", "Europe", "Asia",
"Asia", "Asia", "Asia", "Europe", "Asia", "Europe",
"North America", "Asia", "Asia", "Asia", "Africa", "Asia",
"Asia", "Asia", "Asia", "Europe", "Asia", "Africa",
"Africa", "Europe", "Europe", "Europe", "Africa",
"Africa", "Asia", "Africa", "Europe", "Africa", "Africa",
"North America", "Europe", "Asia", "Africa",
"Africa", "Asia", "Africa", "Asia", "Europe", "Europe",
"South America", "Africa", "Africa", "Europe", "Asia",
"Asia", "North America", "South America",
"South America", "Asia", "Europe", "Europe", "Asia", "Europe",
"Asia", "Africa", "Asia", "Africa", "Europe", "Africa",
"Asia", "Europe", "Europe", "Africa", "Europe",
"Asia", "Africa", "Europe", "Europe", "Asia", "Asia",
"Africa", "Asia", "Africa", "North America", "Africa",
"Asia", "Asia", "Africa", "Europe", "Asia", "Europe",
"North America", "Africa", "Asia", "South America",
"Asia", "Asia", "Africa", "Africa"),
Life_Expectancy = c(48.7, 76.9, 73.1, 51.1, 75.9, 74.2, 81.9, 80.9,
70.7, 75.1, 68.9, 70.3, 80, 76.1, 56.1, 66.6, 75.7,
53.2, 73.5, 73.4, 55.4, 50.4, 63.1, 51.6, 81, 48.4,
49.6, 79.1, 73.5, 73.7, 61.1, 57.4, 48.4, 79.3, 55.4,
76.6, 79.1, 79.6, 77.7, 78.8, 57.9, 73.4, 75.6,
73.2, 72.2, 74.8, 59.3, 80, 81.5, 73.7, 80.4, 64.2, 79.9,
71.2, 54.1, 69.9, 62.1, 73.1, 82.8, 74.4, 81.8,
65.4, 69.4, 73, 69, 80.6, 81.6, 81.9, 73.1, 83.4, 73.4,
67, 57.1, 80.6, 74.6, 67.7, 67.5, 73.3, 72.6, 56.8,
74.8, 72.2, 80, 74.8, 66.7, 54.2, 74.2, 51.4, 79.6,
58.6, 73.4, 77, 69.3, 68.5, 72.2, 50.2, 65.2, 62.5,
68.8, 80.7, 80.7, 74, 54.7, 51.9, 81.1, 65.4, 72.8, 76.1,
72.5, 74, 68.7, 76.1, 79.5, 78.4, 74, 68.8, 55.4,
73.9, 59.3, 74.5, 47.8, 81.1, 75.4, 79.3, 52.8, 81.4,
74.9, 61.5, 81.4, 82.3, 75.9, 67.5, 58.2, 74.1, 57.1,
70.1, 74.5, 74, 65, 54.1, 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, 1.1, 6.2, 4.9, 1.4, 4.6, 1.7, 4.9,
1.8, 1.7, 2.1, 0.6, 1.7, 5.8, 3.6, 6.5, 0.9, 1.1, 2.7,
1.4, 6.2, 4, 4.5, 1.7, 4.2, 2.1, 4.1, 0.9, 4.6, 9.7,
1.3, 1.3, 4, 2.8, 1.3, 3.2, 4.4, 10.7, 5.4, 1.2,
0.8, 3.9, 1.9, 4.3, 2.9, 4.6, 3.3, 2.1, 5.5, 1.3, 0.8,
1.9, 2, 0.8, 6.3, 4.3, 1.6, 2.6, 1.4, 4.8, 0.8, 1.4,
3, 3, 2, 1, 3.9, 4.1, 11.7, 2.8, 4.4, 0.7, 4, 1.5,
2.6, 1.1, 6.1, 4.7, 5.2, 2.6, 4.7, 1.2, 1.6, 5.7, 5,
1.5, 0.9, 1.2, 2.4, 1, 7.6, 1.8, 2.6, 4, 1.6, 3.2, 8.9,
4.7, 7.2, 5.1, 1.8, 3, 1.4, 0.9, 0.8, 1.2),
Happiness_Index = c(36.8, 54.1, 52.2, 33.2, 54.1, 46, 42, 47.1, 40.9,
26.6, 56.3, 37.4, 37.1, 59.3, 31.1, 43.6, 42.4,
22.6, 52.9, 34.1, 31.8, 30.5, 40.3, 33.7, 43.6, 25.3,
24.7, 53.9, 44.7, 59.8, 36.5, 34.5, 30.5, 64, 35.9,
40.6, 56.2, 45.5, 39.4, 36.6, 37.2, 50.7, 52.5, 39.6,
58.9, 34.9, 39.2, 42.7, 46.5, 46, 47.2, 40.3, 40.5,
56.9, 30, 51.2, 41.3, 56, 37.5, 37.4, 40.2, 50.9, 55.5,
41.7, 49.2, 42.4, 55.2, 46.4, 58.5, 47.5, 51.7, 34.7,
38, 43.8, 27.1, 49.1, 49.1, 34.9, 42.9, 35.2, 40.8,
34.6, 29, 28.3, 46.8, 42.5, 40.5, 26, 43.1, 32.3,
36.6, 52.9, 48, 26.8, 47.9, 35.7, 44.2, 38.9, 45.6,
43.1, 51.6, 57.1, 26.8, 33.6, 51.4, 54.1, 51.2, 57.8,
45.8, 52.4, 52.4, 42.6, 38.7, 25.2, 42.2, 34.5, 36.9,
46, 33.3, 41.3, 28.8, 39.8, 40.1, 40.2, 28.2, 44.1,
49.4, 37.6, 46.2, 50.3, 47.1, 47.8, 30.7, 53.5, 28.2,
30.3, 48.3, 47.6, 39.1, 31.5, 37.6, 31.8, 47.9, 37.3,
39.3, 46, 56.9, 60.4, 43, 37.7, 35.3)
)
library(tidyverse)
sample_df %>%
ggplot(aes(x = Life_Expectancy, y = Life_Satisfaction, color = Country)) +
geom_point(size=4, show.legend = FALSE) +
ggtitle("Jielan Liu Question 4") +
theme(plot.title=element_text(hjust=0.5))
Created on 2019-11-30 by the reprex package (v0.3.0.9000)