diff --git a/DailyMeetingPlot.R b/DailyMeetingPlot.R new file mode 100644 index 0000000..590ff84 --- /dev/null +++ b/DailyMeetingPlot.R @@ -0,0 +1,11 @@ +#Generate a scatter plot showing the average time I spent in meetings (per day) during the month of November. + +data = read.table("MeetingData.csv", header = TRUE, sep = ",", stringsAsFactors = FALSE) +data$Day <- factor(data$Day, levels = data$Day) +library(ggplot2) +ggplot(data, aes(x = Day, y = Hours)) + + geom_point() + + theme_classic() + + geom_smooth(method = "lm") + + diff --git a/MeetingData.csv b/MeetingData.csv new file mode 100644 index 0000000..11d86c7 --- /dev/null +++ b/MeetingData.csv @@ -0,0 +1 @@ +Day,Hours Monday,4.325 Tuesday,4 Wednesday,3.5 Thursday,3.125 Friday,2.5 \ No newline at end of file diff --git a/Problem 2.R b/Problem 2.R new file mode 100644 index 0000000..c966fd3 --- /dev/null +++ b/Problem 2.R @@ -0,0 +1,23 @@ +##Generate a barplot of the means of the four populations + +#Load the data file +df <- read.table("data.txt", header = TRUE, sep=",", stringsAsFactors = TRUE) + +#Create the barplot +ggplot(data = df, aes(x = region, y = observations))+ + stat_summary(fun = mean, geom = "bar")+ + theme_classic() + +##Generate a scatterplot of all of the observations + +ggplot(data = df, aes(x = region, y = observations)) + + geom_point() + + geom_jitter() + + theme_classic() + +#The barplot of the means, without error bars, makes the data appear as though +#the observations from the four regions are very similar. While the means of the +#regions are similar, the scatterplot shows that the clustering of the data is +#very different across the regions and the north region is the only region with +#observations clustered around the mean. Error bars on the barplot would show +#the data more accurately.