From 98678cfd1843bbab03b2a497f92d698d68a99d4e Mon Sep 17 00:00:00 2001 From: Riley Ellingsen Date: Mon, 22 Nov 2021 19:04:12 -0500 Subject: [PATCH 1/3] Added data file for problem 1 containing the average hours I spent in meetings per day during the past month. --- MeetingData.csv | 1 + 1 file changed, 1 insertion(+) create mode 100644 MeetingData.csv 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 From 8d454c354ade9c9b3bcb626f919fa2933a4a8a78 Mon Sep 17 00:00:00 2001 From: Riley Ellingsen Date: Mon, 22 Nov 2021 19:05:18 -0500 Subject: [PATCH 2/3] An R script that plots the meeting time data --- DailyMeetingPlot.R | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 DailyMeetingPlot.R 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") + + From 94add4dd90cf50dbc5f877cf6fd57cb694349e43 Mon Sep 17 00:00:00 2001 From: Riley Ellingsen Date: Thu, 25 Nov 2021 12:23:10 -0500 Subject: [PATCH 3/3] Commit script for problem 2 --- Problem 2.R | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Problem 2.R 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.