The code chunk below uses the variables ‘Year’ and ‘NumberOfDeaths’ (x,y).
To display a chart, giving a view of the total amount of Deaths from Heart Disease.
For the years of 2012-2021.
# Install packages
pacman::p_load(pacman,tidyverse,GGally,ggthemes,ggvis,httr,plotly,rio,rmarkdown,shiny)
# Import data
d1 <- read.csv("dc0512a8-eb49-43b9-84f1-17ef95365d57.csv")
plot(d1$Year, d1$NumberOfDeaths, # plot with colour and labels
col="red",
pch=19, # Use solid circles for points
main=" Scottish Heart Disease: Year vs. Number of Deaths",
xlab="Year",
ylab="Total Deaths from Heart Disease")