Web Content Display

Web Content Display (CoastWatch User Forum)

The NOAA CoastWatch Forum provides information in several categories.  The information is relevant to CoastWatch products and software (https://coastwatch.noaa.gov)  and vary in technical details.  For questions and issues not addressed here,  start a thread in the appropriate category or contact the CoastWatch HelpDesk (coastwatch.info@noaa.gov).  Please note our Privacy Policy (https://www.noaa.gov/privacy.html) and that this is a public forum.  All information is voluntarily and anonymous submissions are accepted pending review prior to posting. 

Forums

Back

RE: R Tutorial questions

U
Anonymous, modified 3 Years ago.

R Tutorial questions

Hi - I am going through the tutorial here: https://github.com/CoastWatch-WestCoast/ERDDAP-basics/blob/master/lessons/md/04-Erddapurl.md and am getting an error when I try to bring the data into R:

getwd()
[1] "C:/Users/Dragonoak/Documents/work/R/CoastWatch"
> list.files()
[1] "ERDDAP.R"        "myDataFile.nc"   "Prerequisites.R"
> # open the netCDF file
> library(ncdf4)
> nc <- ncdf4::nc_open("myDataFile.nc")
Error in R_nc4_open: Invalid argument
Error in ncdf4::nc_open("myDataFile.nc") : 
  Error in nc_open trying to open file myDataFile.nc (return_on_error= FALSE )

Also, I have been getting this error when using the dataset referenced in the tutorials so I am using nesdisGeoPolarSSTN5SQ instead: 

Error {
    code=404;
    message="Not Found: Currently unknown datasetID=jplUKMO_OSTIAv20.nc";
}

I can try to make office hours tomorrow - thanks!

MA
Melanie Abecassis, modified 3 Years ago.

RE: R Tutorial questions

Youngling Posts: 65 Join Date: 6/12/17 Recent Posts

Hi,

Yes, I tried the code and get the same error, not sure why.
This worked for me in Windows (you need to install the 'httr' library if you don't have it already):

library(httr)
junk <- GET(erddap_url, write_disk("myDataFile.nc", overwrite=TRUE))

And thanks for identifying the wrong dataset ID, we'll update the tutorial.

U
Anonymous, modified 3 Years ago.

RE: R Tutorial questions

Thanks Melanie - that worked for me! - Rani

MA
Melanie Abecassis, modified 3 Years ago.

RE: R Tutorial questions

Youngling Posts: 65 Join Date: 6/12/17 Recent Posts

Great!! Thanks for confirming!

DR
Dale Robinson, modified 3 Years ago.

RE: R Tutorial questions

Youngling Posts: 16 Join Date: 9/26/16 Recent Posts

Hi,

That dataset is not available at the moment. I am checking with the data provider to find out why. To get the tutorial to work, try replacing "jplUKMO_OSTIAv20" with "nesdisGeoPolarSSTN5SQ" anywhere to see it in the tutorial. This fix worked when I tried it.

-Dale

Reply to Main Thread
Quick Reply