In: Computer Science
3. (Exercise 3.4) Use the Marriage data from the mosaicData package a) Create a bar plot to show the frequency counts for each race b) Create a histogram to show the age distribution c) What distribution can you see for age? (Use comments to write in your R Markdown file) d) Create a time-series plot to show the delay by ceremony date (Note: you need to create a vector x<-1:98 first, and then create a new data frame with x=x and y=delay.)
install.packages("mosaic")#install library
library(mosaicData)#load library
attach(Marriage)#load data
barplot(table(race))#create barplot of race
hist(age)#create historam
#The distribution looks like normal distribution
#creating dataframe
x<-1:98
df=data.frame('x'<-x,'y'<-delay)
#plotting time series plot
plot.ts(df)