if(interactive()){
# read a single file, look at it and plot
sst <- read.nasaoc("A20130892013096.L3m_8D_SST4_sst4_4km.nc",
lats=c(20, 30), lons=c(-130, -105))
sst
str(sst)
plot(sst)
# read several files residing in the working directory
files <- list.files(pattern = glob2rx("*.nc"))
lats <- c(20, 30)
lons <- c(-130, -105)
mSST <- read.nasaoc(files, lats, lons)
# plotting the first processed file
plot(mSST)
# plotting the second processed file
plot(mSST, period = 2)
}
Run the code above in your browser using DataLab