library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.0.5
temp = read.csv("Temperature.csv")
salplot = ggplot(temp, aes(x=Salinity))
salplot + geom_histogram(binwidth = 1)
## Warning: Removed 798 rows containing non-finite values (stat_bin).
salplot + geom_histogram(fill='lightblue') + facet_wrap(~ Year) + ggtitle("Salinity by Year")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 798 rows containing non-finite values (stat_bin).
salplot + geom_histogram(fill='lightblue') + facet_wrap(~ Month) + ggtitle("Salinity by Month")
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 798 rows containing non-finite values (stat_bin).
staplot = ggplot(temp, aes(x=Station, y=Salinity))
staplot + geom_boxplot(aes(x=reorder(Station, Salinity, median, na.rm=TRUE))) + ggtitle ("Station Salinity")
## Warning: Removed 798 rows containing non-finite values (stat_boxplot).
sta2plot = staplot + geom_boxplot(aes(x=reorder(Station, Salinity, median, na.rm=TRUE))) + ggtitle ("Station Salinity")
ggsave("Sation_Salinity.png", sta2plot)
## Saving 7 x 5 in image
## Warning: Removed 798 rows containing non-finite values (stat_boxplot).
making the variable
temp$decdate = temp$Year + temp$dDay3 / 365
templot = ggplot(temp, aes(x=decdate, y=Temperature))
templot + geom_point() + geom_smooth(method = 'lm')
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 927 rows containing non-finite values (stat_smooth).
## Warning: Removed 927 rows containing missing values (geom_point).
sal3plot = ggplot(temp, aes(x=decdate, y=Salinity))
sal3plot + geom_point() + geom_smooth(method = 'lm')
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 798 rows containing non-finite values (stat_smooth).
## Warning: Removed 798 rows containing missing values (geom_point).
sal3plot + geom_point() + facet_wrap(~ Area) + geom_smooth(method='lm')
## `geom_smooth()` using formula 'y ~ x'
## Warning: Removed 798 rows containing non-finite values (stat_smooth).
## Warning: Removed 798 rows containing missing values (geom_point).
sal3plot + geom_line(aes(color=Area)) + facet_wrap(~ Area)