Closed gacolitti closed 4 years ago
I'm getting more than I bargain for when passing one station id with stationid argument to ncdc.
stationid
ncdc
For example:
library(lubridate) #> #> Attaching package: 'lubridate' #> The following objects are masked from 'package:base': #> #> date, intersect, setdiff, union library(rnoaa) d <- ncdc( datatypeid = "TMAX", datasetid = "GHCND", station_id = "GHCND:USW00094728", limit = 1000, startdate = make_date(year = 1869), enddate = make_date(year = 1869 + 1) - 1 ) unique(d$data$station) #> [1] "GHCND:ASN00066062" "GHCND:ASN00074128" "GHCND:ASN00086071" #> [4] "GHCND:ASN00090015" "GHCND:AU000005901" "GHCND:BE000006447" #> [7] "GHCND:CA006101872" "GHCND:CA006106362" "GHCND:CA006110549" #> [10] "GHCND:CA006122845" "GHCND:CA006137735" "GHCND:CA006139520" #> [13] "GHCND:CA006148100" "GHCND:CA006150689" "GHCND:CA006153192" #> [16] "GHCND:CA006158350" "GHCND:CA006166416" "GHCND:CE000043497" #> [19] "GHCND:EI000003969" "GHCND:EIE00101859" "GHCND:EZE00100082" #> [22] "GHCND:GM000004204" "GHCND:GME00125218" "GHCND:ITE00100550" #> [25] "GHCND:ITE00100554" "GHCND:SZ000006717" "GHCND:UK000047811" #> [28] "GHCND:UK000056225" "GHCND:USC00144559" "GHCND:USC00271682" #> [31] "GHCND:USC00288878" "GHCND:USC00474966" "GHCND:USW00094728" #> [34] "GHCND:CE000434730"
Created on 2020-06-27 by the reprex package (v0.3.0)
I expect only "GHCND:USW00094728" to be returned.
looks like you have station_id. Did you try stationid ?
station_id
That was it. Sorry for not catching that.
thanks for the question
I'm getting more than I bargain for when passing one station id with
stationid
argument toncdc
.For example:
Created on 2020-06-27 by the reprex package (v0.3.0)
I expect only "GHCND:USW00094728" to be returned.
Session Info
```r R version 4.0.1 (2020-06-06) Platform: x86_64-apple-darwin17.0 (64-bit) Running under: macOS Catalina 10.15.5 Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] magrittr_1.5 lubridate_1.7.9 forcats_0.5.0 stringr_1.4.0 dplyr_1.0.0 purrr_0.3.4 readr_1.3.1 tidyr_1.1.0 [9] tibble_3.0.1 ggplot2_3.3.2 tidyverse_1.3.0 lawn_0.5.0 rnoaa_1.0.0 loaded via a namespace (and not attached): [1] Rcpp_1.0.4.6 lattice_0.20-41 assertthat_0.2.1 digest_0.6.25 utf8_1.1.4 V8_3.2.0 R6_2.4.1 [8] cellranger_1.1.0 backports_1.1.8 reprex_0.3.0 httr_1.4.1 pillar_1.4.4 rlang_0.4.6 curl_4.3 [15] readxl_1.3.1 rstudioapi_0.11 blob_1.2.1 urltools_1.7.3 htmlwidgets_1.5.1 triebeard_0.3.0 munsell_0.5.0 [22] broom_0.5.6 compiler_4.0.1 modelr_0.1.8 pkgconfig_2.0.3 htmltools_0.4.0 tidyselect_1.1.0 gridExtra_2.3 [29] httpcode_0.3.0 XML_3.99-0.3 fansi_0.4.1 withr_2.2.0 crayon_1.3.4 hoardr_0.5.2 dbplyr_1.4.4 [36] rappdirs_0.3.1 crul_0.9.0 grid_4.0.1 nlme_3.1-148 jsonlite_1.6.1 gtable_0.3.0 lifecycle_0.2.0 [43] DBI_1.1.0 scales_1.1.1 cli_2.0.2 stringi_1.4.6 fs_1.4.1 leaflet_2.0.3 xml2_1.3.2 [50] ellipsis_0.3.1 generics_0.0.2 vctrs_0.3.1 tools_4.0.1 glue_1.4.1 hms_0.5.3 crosstalk_1.1.0.1 [57] yaml_2.2.1 colorspace_1.4-1 rvest_0.3.5 haven_2.3.1 ```