```rsetwd("/Users/myron/Documents/R/CSV Files")library(ggplot2)library(readr)library(dplyr)library(MASS)library(gridExtra)library(gganimate)library(magrittr)Data_New <- read_csv("Data_New.csv")View(Data_New)head(Data_New)``````# A tibble: 6 x 5 year Country Mathmatics Science Reading 1 2000 Hong Kong 560 525 5412 2000 Japan 557 550 5223 2000 South Korea 547 552 5254 2000 United States 493 499 5045 2000 Finland 536 538 5466 2003 Hong Kong 550 539 510``````r# Keep only 3 namesData <- Data_New %>% filter(Country %in% c("Japan", "South Korea", "United States", "Hong Kong", "Finland")) #filter(sex=="F")# PlotData %>% ggplot(aes(x=year, y=Mathmatics, group=Country, color=Country)) + geom_line() + geom_point() + #scale_color_viridis(discrete = TRUE) + ggtitle("Pisa Math scores over the past 20 years") + #theme_ipsum() + ylab("Subject Scores") + transition_reveal(year)```![plot of chunk unnamed-chunk-1](test_pisa1-figure/unnamed-chunk-1-1.gif)

setwd("/Users/myron/Documents/R/CSV Files")

library(ggplot2)
library(readr)
library(dplyr)
library(MASS)
library(gridExtra)
library(gganimate)
library(magrittr)

Data_New <- read_csv("Data_New.csv")
View(Data_New)
head(Data_New)
# A tibble: 6 x 5
   year Country       Mathmatics Science Reading
  <dbl> <chr>              <dbl>   <dbl>   <dbl>
1  2000 Hong Kong            560     525     541
2  2000 Japan                557     550     522
3  2000 South Korea          547     552     525
4  2000 United States        493     499     504
5  2000 Finland              536     538     546
6  2003 Hong Kong            550     539     510
# Keep only 3 names
Data <- Data_New %>%
  filter(Country %in% c("Japan", "South Korea", "United States", "Hong Kong", "Finland")) 
  #filter(sex=="F")

# Plot
Data %>%
  ggplot(aes(x=year, y=Science, group=Country, color=Country)) +
  geom_line() +
  geom_point() +
  #scale_color_viridis(discrete = TRUE) +
  ggtitle("Pisa Science scores over the past 20 years") +
  #theme_ipsum() +
  ylab("Subject Scores") +
  transition_reveal(year)

plot of chunk unnamed-chunk-2