test_pisa1

First Slide

For more details on authoring R presentations please visit https://support.rstudio.com/hc/en-us/articles/200486468.

  • Bullet 1
  • Bullet 2
  • Bullet 3

Slide With Code

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=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

Slide With Plot

plot of chunk unnamed-chunk-2