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.extra.fill_expert and ISRaD.extra.Cstocks perform duplicate functions #205

Closed jb388 closed 4 years ago

jb388 commented 4 years ago

The ISRaD_extra functions ISRaD.extra.fill_expert and ISRaD.extra.Cstocks are very similar. To avoid duplication, I have provisionally removed the ISRaD.extra.fill_expert function from the CRAN release version of the package.

@alkalifly Would you be willing to look at the Cstocks function and let me know if that function will work for you instead of the fill_expert function?

The differences between the two functions are as follows: 1) fill_expert does not use coarse fragment content in the calculations of C stocks, which I think is problematic. 2) Cstocks does not fill BD from SOC stocks, but does fill bd_samp from bd_tot for records without reported coarse fragments (perhaps the first functionality could be added). 3) Cstocks fills c_org from c_tot for records without c_inorg, but fill_expert does not. 4) fill_expert creates a new column "lyr_14c_fill_extra" that is simply a duplicate of "lyr_14c". Not sure why this is useful?

jb388 commented 4 years ago

FYI I just added the backfill of BD from SOC stocks (no. 2 above).

jb388 commented 4 years ago

Sorry for the chatter, but one more thing: even though I pulled the "fill_expert" function from the package, I am still using it when building ISRaD_extra, so your columns will still be there unchanged.