Closed mdwhitby closed 5 years ago
thank @mdwhitby - please share what function you are referring to and example code that gives you the two different results
I download the data with the isd() function. It actually appears to be the same station, but different years (720308-04992 in 2015 and 2016). The relevant output should be in the printed header I included.
First thing is: update rnoaa
to the latest version on CRAN v0.6.6
https://cran.rstudio.com/web/packages/rnoaa/ then try again and tell me what you get.
updating did not seem to help. Looking through the source I speculate that it is actually a problem with the isdparser::isd_parse() function. on line 59 you "use tibble::as_data_frame(df)". I think tibble is automatically formating columns, and for some reason the date column is changed only occasionaly. is there a way to force all columns to be character? Or does it have to be a tibble? Personally, since I am pulling 3 years of data from 30+ stations i am not opposed to having them as data.tables.
This is the first 2 list elements returned from rnoaa::isd() in an apply() usaf_station [1] "720308" wban_station [1] "04992"
class(data1[[1]]$date) #2015 data from station [1] "Date" class(data1[[2]]$date) #2016 data from station [1] "character"
Michael Whitby michael.whitby@gmail.com 609-923-0973
On Mon, Mar 6, 2017 at 3:38 PM, Scott Chamberlain notifications@github.com wrote:
First thing is: update rnoaa to the latest version on CRAN v0.6.6 https://cran.rstudio.com/web/packages/rnoaa/ then try again and tell me what you get.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@mdwhitby thanks for the update.
are you sure the above report is using the latest rnoaa
? i only ask because i'm using the exact same version of rnoaa
on CRAN and I don't get the problem you're reporting - i have tibble v1.2
as well so that's not different
I haven't seen all your code - it's possible you're doing something that's affecting the output and/or perhaps you have options that load in your R session that are coming into play here
I think I finally tracked it down.
When I originally coded I used "regular" R. This used rnoaa 0.6.6 and cached columns in character formats. I then switched to the MRAN version (for speed in doing a lot of data), it uses rnoaa 0.6.5 and chached any new files with the Date format. By deleteing the cache and not switching between versions the columns remain constaint.
You may consider having a cache folder for each version.
Michael Whitby michael.whitby@gmail.com 609-923-0973
On Tue, Mar 7, 2017 at 12:56 PM, Scott Chamberlain <notifications@github.com
wrote:
@mdwhitby https://github.com/mdwhitby thanks for the update.
are you sure the above report is using the latest rnoaa? i only ask because i'm using the exact same version of rnoaa on CRAN and I don't get the problem you're reporting - i have tibble v1.2 as well so that's not different
I haven't seen all your code - it's possible you're doing something that's affecting the output and/or perhaps you have options that load in your R session that are coming into play here
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/205#issuecomment-284820272, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdHZvAgTCoLMVy3nT_2OgYipZAT58iPks5rjahLgaJpZM4MUeWU .
glad you figured it out.
You may consider having a cache folder for each version.
for each version of what?
any new update of rnoaa - say /rnoaa/v066 and when updated /rnoaa/v067. That would force it to use the cache from that version or rnoaa and make sure the cleaned data is in the same format.
Michael Whitby michael.whitby@gmail.com 609-923-0973
On Tue, Mar 7, 2017 at 2:36 PM, Scott Chamberlain notifications@github.com wrote:
glad you figured it out.
You may consider having a cache folder for each version.
for each version of what?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/rnoaa/issues/205#issuecomment-284850722, or mute the thread https://github.com/notifications/unsubscribe-auth/AXdHZlxtsPNx04qDWYGhthMK2cpiUKavks5rjb_KgaJpZM4MUeWU .
Hmm, maybe - i might rather just make sure the docs are clear on this - and maybe i could have a message to the user about checking that their cache
Hello,
Great package, almost everything I need!
I have found a problem that appears to have happened with a recent update I did (not sure if it was tidyverse or Rnoaa).
When I download data from different ISD stations I get 2 different date formats. One is formated as a character, but the other comes in as a date format. An example is below. I used lapply to download stations by year. data[[2]] date is a chr, while data[[1]] it is a date.
I think this might have something to do with reading or converting the data to a tibble where it is autoformating.
data[[2]][1:10,1:5]
A tibble: 10 × 5
total_chars usaf_station wban_station date time