International-Soil-Radiocarbon-Database / ISRaD

Repository for the development and release of ISRaD data and tools
https://international-soil-radiocarbon-database.github.io/ISRaD/
24 stars 15 forks source link

ISRaD.getdata() - how do I update data? #192

Closed aahoyt closed 5 years ago

aahoyt commented 5 years ago

ISRaD_extra <-ISRaD.getdata(directory = mydir, dataset="full", extra = T)

This doesn't update with the latest data, but just returns the one I already had. What should I use instead so that this command will update with the latest data from the website? (without updating the package)

Thanks!

greymonroe commented 5 years ago

Hmm let me check. I will be working on this and everything else ISRaD related through the weekend,

On Jun 20, 2019, at 4:57 PM, Alison Hoyt notifications@github.com wrote:

ISRaD_extra <-ISRaD.getdata(directory = mydir, dataset="full", extra = T)

This doesn't update with the latest data, but just returns the one I already had. What should I use instead so that this command will update with the latest data from the website? (without updating the package)

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/International-Soil-Radiocarbon-Database/ISRaD/issues/192?email_source=notifications&email_token=AD7HB7BKTAKC55VLPLNKF6DP3OLFLA5CNFSM4HZUPKN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G2XK4SA, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7HB7F42HV552NKA3SNYCLP3OLFLANCNFSM4HZUPKNQ.

jb388 commented 5 years ago

Could be the same issue Sophie was having: Did you delete the old versions of the data in the directory you set in the function? If not, the function won't retrieve new ones.

It is working for me.

aahoyt commented 5 years ago

Yup, that works! What about making it automatically replace the existing data with the new data though?

greymonroe commented 5 years ago

Yea that’s definitely doable.

On Jun 20, 2019, at 8:45 PM, Alison Hoyt notifications@github.com wrote:

Yup, that works! What about making it automatically replace the existing data with the new data though?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

greymonroe commented 5 years ago

Should be fixed in the last commit. getdata now has force_download parameter. I decided not to make it automatically download data because there may be cases when people want to work with an older version of the database and we dont want to replace their local file without them setting force_download = T.

aahoyt commented 5 years ago

fyi, the updated function only worked for me after I deleted the old existing data from the folder. When I ran the updated function before I had deleted the old data, it gave the following errors below:

Error:

ISRaD_only <-ISRaD.getdata(directory = mydir, dataset="full", extra = F, force_download = F) Error in gzfile(file) : invalid 'description' argument

ISRaD_only <-ISRaD.getdata(directory = mydir, dataset="full", extra = F, force_download = T)

ISRaD_database_files not found... Downloading database files from. https://github.com/International-Soil-Radiocarbon-Database/ISRaD/raw/master/ISRaD_data_files/database/ISRaD_database_files.zip trying URL 'https://github.com/International-Soil-Radiocarbon-Database/ISRaD/raw/master/ISRaD_data_files/database/ISRaD_database_files.zip' Content type 'application/zip' length 10238477 bytes (9.8 MB) downloaded 9.8 MB Unzipping database files to C:/Users/Alison/Dropbox (MIT)/14Constraint/Research/Incubation Synthesis//ISRaD_database_files ... Error in gzfile(file) : invalid 'description' argument

Examples without the extra argument:

ISRaD_extra <-ISRaD.getdata(directory = mydir, dataset="full", extra = T) Error in gzfile(file) : invalid 'description' argument ISRaD_only <-ISRaD.getdata(directory = mydir, dataset="full", extra = F) Error in gzfile(file) : invalid 'description' argument

greymonroe commented 5 years ago

what was the value of mydir in the examples above?

aahoyt commented 5 years ago

mydir <- "C:/Users/Alison/Dropbox (MIT)/14Constraint/Research/Incubation Synthesis/"

Also, I no longer have that error if I run the function now with files already in the folder, although now the files I have are already the latest ones, while before I was running it with earlier files in the folder.

greymonroe commented 5 years ago

Hmm, had you manually changed any of the files in there?

On Jun 22, 2019, at 5:36 PM, Alison Hoyt notifications@github.com wrote:

mydir <- "C:/Users/Alison/Dropbox (MIT)/14Constraint/Research/Incubation Synthesis/"

Also, I no longer have that error if I run the function now with files already in the folder, although now the files I have are already the latest ones, while before I was running it with earlier files in the folder.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/International-Soil-Radiocarbon-Database/ISRaD/issues/192?email_source=notifications&email_token=AD7HB7GCDXH6DILWAVWPASTP3ZBIHA5CNFSM4HZUPKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKL2PQ#issuecomment-504675646, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7HB7FBWXXZA55L6SRHJ5DP3ZBIHANCNFSM4HZUPKNQ.

aahoyt commented 5 years ago

Nope!

If there's no obvious reason it happened, maybe it's not worth worrying about unless it comes up again....

greymonroe commented 5 years ago

Hmm yeah strange. We can leave the issue open for a bit in case someone else runs in to issues

On Jun 22, 2019, at 6:41 PM, Alison Hoyt notifications@github.com wrote:

Nope!

If there's no obvious reason it happened, maybe it's not worth worrying about unless it comes up again....

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/International-Soil-Radiocarbon-Database/ISRaD/issues/192?email_source=notifications&email_token=AD7HB7HNDMM7OQEO2QMUCWLP3ZI5DA5CNFSM4HZUPKN2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYKNBPA#issuecomment-504680636, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7HB7E3ZYVVU4GSH2PEZ7TP3ZI5DANCNFSM4HZUPKNQ.

setrumbore commented 5 years ago

Hi from Sue -- I was having the same problem (download did not update to the latest version. Good news = I read the thread instead of bugging someone personally Bad news = I deleted the old files on my computer, and tried to load again using the same command as before:

mydata<-ISRaD.getdata(directory = "~/Dropbox/IsRad_Data_base/R_scripts", dataset="full", extra = F) The return is: Error in gzfile(file) : invalid 'description' argument

It did download the readme.txt file into the proper folder but nothing else..... I tried reinstalling the package and it still does the same thing. Also tried changing the name of the destination file - that DID work So overall, good news, just would be careful in deleting the old files from the old directory

coreylawrence commented 5 years ago

I'm having a similar problem with the error

gzfile(file):invalid 'description' argument

This happens after the zip file is downloaded but before it is unzipped and occurs with or without a copy of the database files already in the working directory.

I am able to expand the zip file and load data using lines of code from ISRaD.getdata but it fails at the unzip when I run the function. It seems like the problem is with the file path, either for the .zip, the destination folder for the unzip, or both.

Anyways, this does seem like a problem that still needs to be addressed.

aahoyt commented 5 years ago

Agreed. I have also continued to have issues sometimes (not always) when testing this. I'm running an ISRaD training at Livermore National Lab tomorrow, so I'll report back on how many people run into this.

jb388 commented 5 years ago

Seems like this "invalid 'description' argument" error is universal. But despite the error, the files seem to download for me anyway.

aahoyt commented 5 years ago

Also, in case anyone is looking for a fast work around, you can: (1) Download the full zip folder from this page: https://international-soil-radiocarbon-database.github.io/ISRaD/database/ (blue download link) (2) load the R data object (.rda file) object into R using the command: "load( full fil path here)"

christinaschaedel commented 5 years ago

I'm having an issue downloading the data as well and will use the work around approach for now

greymonroe commented 5 years ago

for those with the issue, have you tried setting force_download = T in the get_data() function?

Also, what operating system are you working on?

jb388 commented 5 years ago

@greymonroe get_data() seems to be working after the rebuild. Did you fix something specific?

greymonroe commented 5 years ago

@greymonroe get_data() seems to be working after the rebuild. Did you fix something specific?

@jb388 hmm no nothing that would explain why its working now.

greymonroe commented 5 years ago

OK but now i did figure out what was wrong and it should be fixed.

Had to add some code to delete the old files. I also added some code so that users have to verify they want to delete the old files

jb388 commented 5 years ago

Ok, great. I thought it may have to do with the extra files. Good work---thanks!

christinaschaedel commented 5 years ago

yes, it worked for me too now. Thank you!