Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
6 changes: 6 additions & 0 deletions AgetoSalary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Age Salary
25 45663.9
35 68831.49
45 78679.09
55 75324.28
65 68826.28
23 changes: 23 additions & 0 deletions Exercise09-HunterGonzalez.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
library(ggplot2)
#Question1
averagesalary<-read.table("AgetoSalary.txt",header=TRUE,sep="\t",stringsAsFactors=FALSE)
ggplot(data = averagesalary, aes(x=Age,y=Salary))+
geom_point()+
stat_smooth(method="lm")
theme_classic()
#Question2
data=read.table("data.txt",header=TRUE,sep=",",stringsAsFactors=FALSE)
## Barplot of the means of the two populations
ggplot(data, aes(x=region, y=observations, fill=as.factor(region))) +
stat_summary(geom="bar", fun="mean") +
xlab("Regions") +
ylab("Average # of Observations")+
theme_bw()

##Scatterplot of all of the observations
ggplot(data = data, aes(x=region, y=observations))+
geom_point() +
geom_jitter()+
theme_bw()
#Stories of the Scatterplot vs Bar Plot: The bar plot makes it seem like there are a fairly similar amount of average observations, but the
# scatter plot shows that there are vastly different distributions for the observations in different regions
13 changes: 13 additions & 0 deletions Exercise09.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX