From 28ec73f5586155ebe1f79fb34ca5b0191bb8afd6 Mon Sep 17 00:00:00 2001 From: Keith O'Connor Date: Thu, 12 Oct 2017 22:44:14 -0400 Subject: [PATCH 1/3] This script can be executed to make a scatterplot for stable carbon and nitrogen isotopes found in different Alaskan soils. --- ExerciseScript7_2.R | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 ExerciseScript7_2.R diff --git a/ExerciseScript7_2.R b/ExerciseScript7_2.R new file mode 100644 index 0000000..96e74d8 --- /dev/null +++ b/ExerciseScript7_2.R @@ -0,0 +1,10 @@ +library(ggplot2) +library(grid) +library(gridExtra) + +SoilIsotopes <- read.table("~/Desktop/Alaska Data/EA-IRMS/170517_EA-IRMS_MASTERSPREADSHEET.txt",sep = ' ',header=TRUE) + +EAIRMS <- read.csv("~/Desktop/Alaska Data/EA-IRMS/170517_EA-IRMS_MASTERSPREADSHEET.csv") + +a <- ggplot(data = EAIRMS, aes(x = Corrected.d15N, y = Corrected.d13C)) +a + geom_point(color = "cyan", shape = 17, size = 3) + coord_cartesian() + theme_classic() + ggtitle("Alaska Soils") + ylab("d13C") + stat_smooth(method = "lm") \ No newline at end of file From b996ab087cdc0f8ce3ad697cd06c57741d1ed12f Mon Sep 17 00:00:00 2001 From: Keith O'Connor Date: Thu, 12 Oct 2017 22:46:11 -0400 Subject: [PATCH 2/3] This script can be executed to produce a bar graph and scaterplot of populations from the regions in the data.txt file --- ExerciseScript7_3.R | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 ExerciseScript7_3.R diff --git a/ExerciseScript7_3.R b/ExerciseScript7_3.R new file mode 100644 index 0000000..2b21bdc --- /dev/null +++ b/ExerciseScript7_3.R @@ -0,0 +1,11 @@ +library(ggplot2) +library(grid) +library(gridExtra) +Data <- read.csv("~/Desktop/data-shell/Intro_Biocomp_ND_317_Tutorial7/data.txt",sep = ',',header=TRUE) +##This script can be executed to produce a bar graph of populations from the regions in the data.txt file +a = ggplot(data = Data) +a + geom_bar(aes(x = as.factor(region), y = observations), stat = "summary", + fun.y = "mean", fill = "black", color = "black") + theme_classic() + xlab("Regions") + ylab("Population") +##This script can be executed to produce a scatterplot of the popualtions from the regions in the data.txt file. +b = ggplot(data = Data, aes(x = region, y = observations)) + theme_classic() +b + geom_point() + geom_jitter()+ xlab("Regions") + ylab("Population") \ No newline at end of file From 1bc5ef84cd375fa8b3576b43a23cfc58eb21b734 Mon Sep 17 00:00:00 2001 From: Kyle Dubiak Date: Thu, 12 Oct 2017 23:27:27 -0400 Subject: [PATCH 3/3] Exercise7_1 script to make histograms of sequence data --- Exercise7_1.R | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Exercise7_1.R diff --git a/Exercise7_1.R b/Exercise7_1.R new file mode 100644 index 0000000..2355ece --- /dev/null +++ b/Exercise7_1.R @@ -0,0 +1,14 @@ +fastadata<-scan(file="Lecture11.fasta",what=character()) +#Make indices of either even or odd numbers to 200 +x<-1:200 +oddintegers<-x[c(TRUE,FALSE)] +evenintegers<-x[c(FALSE,TRUE)] +Sequences<-fastadata[evenintegers] +#count number of nucleotides in sequences and plot histogram +SeqLength<-nchar(Sequences) +HistofLength<-qplot(SeqLength,geom="histogram") +#Similar histogram but of the number of G's and C's in sequences +SeqWithoutA<-gsub("A","",Sequences) +SeqWithoutAT<-gsub("T","",SeqWithoutA) +GCSeqLength<-nchar(SeqWithoutAT) +qplot(GCSeqLength,geom="histogram")