Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Two years ago, I wrote a software package for R called “rNOMADS” that interfaces with online weather and sea ice model repositories to gather data in real time, for free. The data are delivered in two ways: a simple, pure R, cross platform interface using GrADS-DODS, and binary files in GRIB format. The one issue with GRIB is that this format can’t be read directly into R; it requires the external program “wgrib2.” Installing rNOMADS with GRIB support for Linux is covered in this post (Mac OS is probably similar). I thought GRIB support for Windows was impossible until the guy who runs this blog casually told me he’d figured it out. So, I finally got around to trying it myself, and I’m happy to say I got it to work! Here’s how:
Step 1:
Download the most recent wgrib2.exe version and all DLL files from Wesley Ebisuzaki’s web site: Click here.
Step 2:
Make a directory somewhere on your computer. I chose: C:Program Fileswgrib2
Copy the .exe and the .dll files to this directory.
Step 3:
Append the directory path to the Windows PATH variable. Find out how to do this here.
Step 4: If R is open, close and reopen it. Then try the following command in the R interpreter:
system("wgrib2")
If you get a bunch of text that looks like the image below, you’ve succeeded. You can start reading GRIB files with rNOMADS!
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.