Warning: package 'data.table' was built under R version 4.3.3
library(dplyr)
Warning: package 'dplyr' was built under R version 4.3.3
Attaching package: 'dplyr'
The following objects are masked from 'package:data.table':
between, first, last
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
temp <-fread("Temperature.csv") ##reading in data using fread
temp$Season <-factor(temp$Season)winter <-filter(temp, Season =="winter") ##extracting winter observationswinterNC <-filter(temp, Season =="winter", Area =="NC") ##winter observations for NC
area_season_temp <-select(temp, Area, Season, Temperature) ##selecting columns for area, season, temperature
winter_area_temp <-filter(temp, Season =="winter") %>%select(Area, Temperature) ##selecting for area and temperature in winter
number_winter <-nrow(winter) ##number of observations in winterprint(number_winter)
[1] 1706
winter_means <- winter %>%summarise(mean_temp =mean(Temperature, na.rm =TRUE),mean_sal =mean(Salinity, na.rm =TRUE) )winter_means ##calculating means of temperature and salinity in winter
mean_temp mean_sal
1 5.57162 29.15756
station_winter <- winter %>%count(Station) station_winter ##number of observations per station in winter
library(ggplot2)ggplot(temp_month_area, aes(x = Month, y = mean_temp, color = Area)) +geom_line() +labs(title ="Average Temperature by Month and Area",x ="Month",y ="Average Temperature")
Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.
Running Code
When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
1+1
[1] 2
You can add options to executable code like this
[1] 4
The echo: false option disables the printing of code (only output is displayed).