R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

# load the `ncdf4` and the `CFtime` packages
library(ncdf4)
library(CFtime)
## Warning: package 'CFtime' was built under R version 4.3.3
library(lattice)
library(ggplot2)
library(sf)
## Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE
library(maps)
## Warning: package 'maps' was built under R version 4.3.3
library(RColorBrewer)

# set path and filename
ncpath <- "C:/Users/lilyl/OneDrive/Desktop/Files/School/Current/GEOG490RforESS/data/"
ncname <- "G10010_sibt1850_v2.0"  
ncfname <- paste(ncpath, ncname, ".nc", sep="")
dname <- "seaice_conc"  # note: tmp means temperature (not temporary)

# open a netCDF file
ncin <- nc_open(ncfname)

# world_sf
world_sf <- st_as_sf(maps::map("world", plot = FALSE, fill = TRUE))
world_otl_sf <- st_geometry(world_sf)

# stars read of netCDF

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.