-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add script that extracts Soilgrids SOC based on location of sites #3040
Add script that extracts Soilgrids SOC based on location of sites #3040
Conversation
Add file that extracts Soilgrids SOC based on user-defined site locations
Updating extract function w/ documentation changes
…pecan into soilgris_extraction_update Pull changes from upstream
Thanks Chris @infotroph ! Great suggestion! I did test and found out "dplyr::pivot_longer" works well to replace "reshape2::melt". I will update my PR soon.
… On Sep 29, 2022, at 9:10 PM, Chris Black ***@***.***> wrote:
@infotroph commented on this pull request.
In modules/data.land/R/soilgrids_soc_extraction.R <#3040 (comment)>:
> + rownames(ocdquant) <- depths
+ colnames(ocdquant) <- c(rep("Mean", length(internal_site_info$site_info.lon)),
+ rep("0.05", length(internal_site_info$site_info.lon)),
+ rep("0.5", length(internal_site_info$site_info.lon)),
+ rep("0.95", length(internal_site_info$site_info.lon)))
+ rownames(siteid) <- depths
+ colnames(siteid) <- c(rep("Mean", length(internal_site_info$site_info.lon)),
+ rep("0.05", length(internal_site_info$site_info.lon)),
+ rep("0.5", length(internal_site_info$site_info.lon)),
+ rep("0.95", length(internal_site_info$site_info.lon)))
+ if (verbose) {
+ close(pb)
+ }
+
+ # parse extracted data and prepare for output
+ ocd_fit <- reshape2::melt(ocdquant, id.vars = c("Mean"))
Low priority: How difficult would it be to rewrite these manipulations to use something like dplyr::pivot_longer instead of adding reshape2 to the dependency list? data.land has a beastly number of dependencies already, so when there's a choice I recommend preferring solutions that use existing imports rather than add new ones.
—
Reply to this email directly, view it on GitHub <#3040 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFCCZ73TGII3OLAXHKGWLI3WAZR4DANCNFSM6AAAAAAQNCFL34>.
You are receiving this because you were mentioned.
|
…pecan into soilgris_extraction_update Pull from the upstream
Looks like reshape2 is indeed no longer a depends
but we still have some reshape requirements that could be updated at some point |
@Qianyuxuan here are the most recent build errors.
|
So "qgamma" is an R base function yes, same with optim yes (well its stats::optim). Not sure what "name" is referring too |
…pecan into soilgris_extraction_update Pull from the upstream
Thanks! When I made the suggestion I may possibly have been forgetting that |
…to soilgrids_extraction
…build check error
Description
Add a script that extracts total soil organic carbon and its standard deviation based on user-defined site location from SoilGrids250m version 2.0: https://soilgrids.org
Motivation and Context
To provide SOC observations for SDA
Review Time Estimate
Types of changes
Checklist: