#Exercise 1
install.packages(“magick”) library(magick) img <- image_read (“/Users/sydne/OneDrive/Desktop/Rwork/Cow.jpeg”) plot(img)
setwd(“C:/Users/sydne/OneDrive/Documents/RW1”) df <- read.csv(“democracy_2020(1).csv”) head(df, n=5) #195 observations, 7 variables
#Exercise 4 length(which(df$democracy==TRUE)) #118 democracies total #118/195=60.51% democracies
#Exercise 5 mean(df\(democracy_duration) #48.82564 mean longevity median(df\)democracy_duration) #36 median longevity #Since the mean is greater than the median, the data is right-skewed. This means that there is a lower boundary in the dataset and most of the data will be concentrated on the left side of a histogram.
install.packages(“tinytex”)
tinytex::install_tinytex()