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

R object from "compile" function is null #18

Closed jb388 closed 6 years ago

jb388 commented 6 years ago

The compile function runs the QAQC function and generates useful files in the "database" folder of the specified directory. This is great! But it does not generate an R object.

In the old package we had "compileAsList" to return a list, and the function "compile" returned the flat database. Could we have this be an option in the function?

Perhaps we can discuss more next week as we dig into data structure and data management some more.

greymonroe commented 6 years ago

K, should be addressed with last commit. compile() should now return the database in list or flat structure depending on how the return parameter is set in the compile() function, either "list" or "flat" while default is NULL which returns nothing but still completes the compilation and saves appropriate files.

Example:

compiled<-compile(dataset_directory = "~/Desktop/Data/", write_report = T, write_out = T, return="flat")
aahoyt commented 6 years ago

This doesn't seem to be implemented. I get the error:

unused argument (return = "list")

greymonroe commented 6 years ago

Thanks, can you try again?

On Sep 8, 2018, at 10:19 AM, Alison Hoyt notifications@github.com wrote:

This doesn't seem to be implemented. I get the error:

unused argument (return = "list")

— 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/18#issuecomment-419622910, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_BSsmzKhuSujw6ydyDZEKV2uj06eks5uY318gaJpZM4WbGaL.

aahoyt commented 6 years ago

Now the function will run but produces a NULL list after the following error for me: ... Joining, by = c("entry_name", "site_name") Joining, by = c("entry_name", "site_name", "plot_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name", "lyr_name") Joining, by = c("entry_name", "site_name", "pro_name", "lyr_name", "lyr_comp", "frc_name") Error in file(file, ifelse(append, "a", "w")) : cannot open the connection In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file 'C:/Users/Alison/Dropbox/TestCompilation/Updated30-08-2018/database/ISRaD_flat.csv': Permission denied

greymonroe commented 6 years ago

Hmm, does it work if you delete 'C:/Users/Alison/Dropbox/TestCompilation/Updated30-08-2018/database/ISRaD_flat.csv’ file before running the compile function?

On Sep 8, 2018, at 1:17 PM, Alison Hoyt notifications@github.com wrote:

Now the function will run but produces a NULL list after the following error for me: ... Joining, by = c("entry_name", "site_name") Joining, by = c("entry_name", "site_name", "plot_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name") Joining, by = c("entry_name", "site_name", "pro_name", "lyr_name") Joining, by = c("entry_name", "site_name", "pro_name", "lyr_name", "lyr_comp", "frc_name") Error in file(file, ifelse(append, "a", "w")) : cannot open the connection In addition: Warning message: In file(file, ifelse(append, "a", "w")) : cannot open file 'C:/Users/Alison/Dropbox/TestCompilation/Updated30-08-2018/database/ISRaD_flat.csv': Permission denied

— 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/18#issuecomment-419634348, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_EeQUWa_9HOUc0LviFzP_tAPbV5Uks5uY6dmgaJpZM4WbGaL.

aahoyt commented 6 years ago

Yes, now it works! Thanks!

greymonroe commented 6 years ago

Ok cool, yeah that shouldn’t normally be a problem though. Do you know if you currently had the csv file open when you ran the compile function?

On Sep 8, 2018, at 1:33 PM, Alison Hoyt notifications@github.com wrote:

Yes, now it works! Thanks!

— 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/18#issuecomment-419635296, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_CNCoG1uUG_HUnjjJyTALu6ZJWv7ks5uY6segaJpZM4WbGaL.

aahoyt commented 6 years ago

ok yes, just double checked and I think that was the issue - oops!

greymonroe commented 6 years ago

No worries, perhaps there is a workaround so this isnt an issue, or at least generates a message that is useful to the user.

On Sep 8, 2018, at 2:01 PM, Alison Hoyt notifications@github.com wrote:

ok yes, just double checked and I think that was the issue - oops!

— 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/18#issuecomment-419636938, or mute the thread https://github.com/notifications/unsubscribe-auth/AP5w_EoKdI4W33wj4LxVjw5_kDXu_7zrks5uY7GkgaJpZM4WbGaL.