diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..816fa3a Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b6a065 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata diff --git a/AgetoSalary.txt b/AgetoSalary.txt new file mode 100644 index 0000000..b5f6ad0 --- /dev/null +++ b/AgetoSalary.txt @@ -0,0 +1,6 @@ +Age Salary +25 45663.9 +35 68831.49 +45 78679.09 +55 75324.28 +65 68826.28 \ No newline at end of file diff --git a/Exercise09-HunterGonzalez.R b/Exercise09-HunterGonzalez.R new file mode 100644 index 0000000..5e29615 --- /dev/null +++ b/Exercise09-HunterGonzalez.R @@ -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 \ No newline at end of file diff --git a/Exercise09.Rproj b/Exercise09.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/Exercise09.Rproj @@ -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