# NOT RUN {
# Construct query, making it easier to understand and modify.
day <- "2016-01-02"
lon0 <- -66.5
lon1 <- -64.0
lat0 <- 44
lat1 <- 46
source <- paste("https://coastwatch.pfeg.noaa.gov/erddap/griddap/",
"jplG1SST.nc?",
"SST%5B(", day, "T12:00:00Z)",
"%5D%5B(", lat0, "):(", lat1, ")",
"%5D%5B(", lon0, "):(", lon1, ")",
"%5D", sep="")
if (!length(list.files(pattern="^a.nc$")))
download.file(source, "a.nc")
d <- read.g1sst("a.nc")
plot(d, "SST", col=oceColorsJet)
data(coastlineWorldFine, package="ocedata")
lines(coastlineWorldFine[['longitude']],coastlineWorldFine[['latitude']])
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab