Histogram
library(ggplot2)
library(reshape2)
## Warning: package 'reshape2' was built under R version 4.0.5
temp = read.csv("Temperature.csv")
salplot = ggplot(temp, aes(x=Salinity))
salplot + geom_histogram(binwidth = 1.5)
## Warning: Removed 798 rows containing non-finite values (stat_bin).
salplot + geom_histogram(binwidth = 1.5)+ facet_wrap(~ Year)
## Warning: Removed 798 rows containing non-finite values (stat_bin).
salplot + geom_histogram(binwidth = 1.5)+ facet_wrap(~ Month)
## Warning: Removed 798 rows containing non-finite values (stat_bin).
Box Plot
library(ggplot2)
library(reshape2)
temp = read.csv("Temperature.csv")
tempbox = ggplot(temp, aes(x=Station, y=Temperature))
StatTemp = tempbox + geom_boxplot(aes(x=reorder(Station, Temperature, median, na.rm =TRUE))) + theme(axis.text.x = element_text(angle = 90))
StatTemp
## Warning: Removed 927 rows containing non-finite values (stat_boxplot).
ggsave("Temperature by Station.png", StatTemp)
## Saving 7 x 5 in image
## Warning: Removed 927 rows containing non-finite values (stat_boxplot).
library(ggplot2)
temp$decdate <- temp$Year + temp$dDay3 / 365
tempsal = ggplot(temp, aes(x=decdate))
tempsal +
geom_point(aes(y = Temperature, colour = "Temperature")) +
geom_point(aes(y = Salinity, colour = "Salinity")) +
labs(y = "Salinity and Temperature") + labs(x = "Decimal Date") +
labs(colour = "Legend")
## Warning: Removed 927 rows containing missing values (geom_point).
## Warning: Removed 798 rows containing missing values (geom_point).
tempsal + geom_point(aes(y = Salinity)) + facet_wrap(~ Area)
## Warning: Removed 798 rows containing missing values (geom_point).
tempstat = ggplot(temp, aes(x=Year))
tempstat + geom_line(aes(y = Salinity)) + facet_grid(Station ~ Area) + theme_grey(base_size = 7.2) + theme(axis.text.x = element_text(angle = 90))