ropensci / rnoaa

R interface to many NOAA data APIs
https://docs.ropensci.org/rnoaa
Other
330 stars 84 forks source link

Edit readme and vignettes to note and properly convert GHCN values #265

Closed amoeba closed 5 years ago

amoeba commented 6 years ago

I was confounded in https://github.com/ropensci/rnoaa/issues/264 with NOAA's API return value of "tenths of a degree C" for GHCN temperature data and has to ask for help. @sckott deftly linked me the documentation for the dataset over on ftp://ftp.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt which does a much better job than the NOAA API docs do in documenting the dataset. I certainly could've done a better job searching around for information but in the end this was hard to find for me.

Over on https://github.com/ropensci/rnoaa/issues/264 @sckott and I talked about what we could do and settled on at least improving the package docs a bit: I noticed that the readme and at least one of the vignettes grabs temperature data and shows it to the user without transforming to a sensible unit like °C and I think this'd be a great place to help the studious package user out with advice on this.

I'll take a scan through of the readme and vignettes and anywhere else to see if there are places the docs can be improved.

For an example, look at this section of https://github.com/ropensci/rnoaa/blob/master/README.md

head( out$data )
#>                  date        datatype           station value fl_c
#> 1 2010-05-01T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   652    S
#> 2 2010-05-02T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   655    S
#> 3 2010-05-03T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   658    S
#> 4 2010-05-04T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   661    S
#> 5 2010-05-05T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   663    S
#> 6 2010-05-06T00:00:00 DLY-TMAX-NORMAL GHCND:USW00014895   666    S

I think it'd be great to just put a note just below this like

Note: The units of the value column are in tenths of a degree Celsius. By convention, rnoaa doesn't do any conversion of data returned by the API and some APIs return values in unusual units.

sckott commented 6 years ago

Thanks for this. Looking forward to your suggestions

sckott commented 6 years ago

any thoughts on this @amoeba ?

amoeba commented 6 years ago

Just ones about not having done this yet. Sorry! I don't think I'll be able to get to it that fast, but could definitely get it done by the end of November, if not way earlier.

sckott commented 6 years ago

okay, thanks

sckott commented 5 years ago

@amoeba do you think you'll be able to get to this soon?

amoeba commented 5 years ago

Hey, I just took a look and decided to add a blurb in the readme, the ghcn vignette, and the ncdc manpage.

Note that the value column has strangely large numbers for temperature measurements. By convention, the rnoaa package doesn't do any conversion of values from the APIs and some APIs use seemingly odd units. In this case, TMAX values from GHCND are in tenths of degrees Celcius which is a unit you'll see elsewhere when working with NOAA data. See the GHCN-DAILY README for more information.

I'm just documenting and checking the package now. Sorry I sat on this for so long.

amoeba commented 5 years ago

PR'd, in #315. Please have a look. Open to comments on phrasing or locations.

sckott commented 5 years ago

thanks!

sckott commented 5 years ago

fixed in #315