diff --git a/Assignment10Maron.R b/Assignment10Maron.R new file mode 100644 index 0000000..a45996b --- /dev/null +++ b/Assignment10Maron.R @@ -0,0 +1,31 @@ +#Tutorial 12 Assignment +setwd("/Users/erinmaron/Desktop/r-novice-inflammation/BioComp/ClassWork/Biocomp_tutorial12") + +#Problem 1 +#Uses Energy vs. Time Data for a football player doing a flip, data collected from a Physics project +library(ggplot2) +data<-read.table(file="Energy.txt", header=TRUE, sep="\t") + +ggplot(data=data, aes(x=Time, y=Energy))+ + geom_point() + + ylab("Energy(J)")+ + xlab("Time(s)")+ + theme_classic()+ + stat_smooth(method = "lm") + +#Problem 2 +obsv<-read.table(file="data.txt", header=TRUE, sep=",") +#Barplot using means of 4 populations +ggplot(data=obsv, aes(x=region))+ + geom_bar()+ + theme_classic() + +#Scatterplot of all observations (jitter) +ggplot(data=obsv, aes(x=region, y=observations))+ + geom_jitter()+ + theme_classic() + + #The two plots do tell different stories, as the scatterplot shows the distribution of the population +#as well as the different groupings of data. It allows for a visualization of the distribution by region. +#The bar plot does not show much information besides the total number of observations within a region. +#There is no way to diffrentiate from the regions, it is only shown that they all have the same total count. \ No newline at end of file diff --git a/Energy.txt b/Energy.txt new file mode 100644 index 0000000..d6b0133 --- /dev/null +++ b/Energy.txt @@ -0,0 +1,25 @@ +Time Energy +0.03 2804.56318 +0.07 4785.40265 +0.1 12797.61902 +0.13 6785.5305 +0.17 4045.48011 +0.2 3464.37218 +0.23 3850.94958 +0.27 1585.90583 +0.3 1826.28253 +0.33 4062.90954 +0.37 2261.33812 +0.4 1428.47739 +0.43 1721.58945 +0.47 2248.39566 +0.5 1404.22996 +0.53 1160.67113 +0.57 1064.6325 +0.6 1063.47221 +0.63 1030.9257 +0.67 915.12021 +0.7 1027.92638 +0.73 681.57503 +0.77 546.68208 +0.8 909.1173 \ No newline at end of file