ropensci / rnoaa

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

ghcnd_search() produces data ordered by month and not by date #247

Closed ghost closed 6 years ago

ghost commented 6 years ago
data = ghcnd_search('USC00021248',date_min="1981-01-01",date.max="2016-12-31",var='PRCP')
data
$prcp
# A tibble: 13,391 x 6
            id  prcp       date mflag qflag sflag
         <chr> <int>     <date> <chr> <chr> <chr>
 1 USC00021248     0 1981-01-01                 0
 2 USC00021248     0 1981-02-01                 0
 3 USC00021248    10 1981-03-01                 0
 4 USC00021248     0 1981-04-01                 0
 5 USC00021248     5 1981-05-01                 0
 6 USC00021248    53 1981-06-01                 0
 7 USC00021248   150 1981-07-01                 0
 8 USC00021248    48 1981-08-01                 0
 9 USC00021248    18 1981-09-01                 0
10 USC00021248     0 1981-10-01                 0
# ... with 13,381 more rows
sckott commented 6 years ago

thanks @asrivas3 please include the output of sessionInfo() in a code block. (see help on code blocks here https://help.github.com/articles/creating-and-highlighting-code-blocks/ )

to get just a certain column index to it like data$prcp$prcp

ghost commented 6 years ago

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-apple-darwin16.7.0 (64-bit)
Running under: macOS High Sierra 10.13.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.2.20/lib/libopenblasp-r0.2.20.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] rgeos_0.3-26 raster_2.5-8 sp_1.2-5     dplyr_0.7.4  mgcv_1.8-22 
[6] nlme_3.1-131 bindrcpp_0.2 rnoaa_0.7.0 

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.13     compiler_3.4.2   plyr_1.8.4       bindr_0.1       
 [5] tools_3.4.2      digest_0.6.12    lattice_0.20-35  lubridate_1.7.1 
 [9] jsonlite_1.5     tibble_1.3.4     gtable_0.2.0     pkgconfig_2.0.1 
[13] rlang_0.1.2      Matrix_1.2-11    rgdal_1.2-13     curl_3.0        
[17] gridExtra_2.3    httr_1.3.1       stringr_1.2.0    xml2_1.1.1      
[21] rappdirs_0.3.1   grid_3.4.2       tidyselect_0.2.3 glue_1.1.1      
[25] R6_2.2.2         XML_3.98-1.9     ggplot2_2.2.1    tidyr_0.7.2     
[29] purrr_0.2.4      hoardr_0.2.0     magrittr_1.5     scales_0.5.0    
[33] assertthat_0.2.0 colorspace_1.3-2 stringi_1.1.5    lazyeval_0.2.0  
[37] munsell_0.4.3  
ghost commented 6 years ago

Please let me know about any solution.

sckott commented 6 years ago

@asrivas3 reinstall and try again - let me know if it works for you now