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") 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 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