ropensci / rnoaa

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

allbuoys station doesn't match buoys datasets #262

Closed jebyrnes closed 6 years ago

jebyrnes commented 6 years ago

Let's say I do the following

met <- buoys(dataset="stdmet")

One column is id. Now, if I wanted to get the lat/long of all buoys that had stdmet measurements, one would presume I could get that from allbuoys() using a join. However

1) allbuoys produces a stations column instead of id which is fine, except... 2) it appears that any station with letters in its name gets its numbers cutoff. For example

allbuoys <- buoy_stations() 

 allbuoys$station[274:326]

produces

 [1] "91343" "91352" "91355" "91356" "91365" "91374" "91377" "91411" "91442" "6"     "1"     "6"     "2"    
[14] "2"     "2"     "1"     "1"     "3"     "3"     "1"     "2"     "7"     "1"     "6"     "1"     "3"    
[27] "1"     "2"     "1"     "7"     "7"     "01"    "10"    "31"    "32"    "33"    "35"    "36"    "43"   
[40] "52"    "53"    "61"    "62"    "70"    "90"    "91"    "92"    "2"     "1"     "2"     "2"     "7"    
[53] "1"  

It looks like the actual station name is buried in DC.description, but it takes some regexp magic to get it out. Can the station names be fixed in allbuoys?

jebyrnes commented 6 years ago

N.B. many station names are NA, leading me to suspect there's an as.numeric lurking somewhere...

sckott commented 6 years ago

thanks @jebyrnes !

I imagine you are not on the latest github version? Can you update to the latest version and tell me if it works? we should have fixed this, see https://github.com/ropensci/rnoaa/issues/261

sckott commented 6 years ago

closing due to inactivity