#Corvina age and length histograms. Derek Bolser #set working directory setwd('C:/Users/ROV/Documents/R') #import data #name data data1=oneyrcorvinagrowthdata age=data1$Age tl=data1$TL #load packages library(ggplot2) #ggplot Age ggplot(data1, aes(x=age)) + geom_histogram(binwidth=0.5) + theme_classic() + xlab("Age (years)") + ylab("Frequency") + scale_x_continuous(breaks = seq(0,8,1),lim=c(0,9)) + scale_y_continuous(breaks = seq(0,180,10),lim=c(0,180)) #ggplot Lengths ggplot(data1, aes(x=tl)) + geom_histogram(binwidth=10) + theme_classic() + xlab("Total length (mm)") + ylab("Frequency") + scale_x_continuous(breaks = seq(0,1025,25),lim=c(0,1025)) + scale_y_continuous(breaks = seq(0,50,5),lim=c(0,50)) + theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))