Skip to content
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

Merged
merged 22 commits into from
Oct 8, 2022

Conversation

Qianyuxuan
Copy link
Collaborator

@Qianyuxuan Qianyuxuan commented Sep 15, 2022

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

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Qianyuxuan and others added 2 commits September 14, 2022 23:38
Add file that extracts Soilgrids SOC based on user-defined site locations
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
modules/data.land/R/soilgrids_soc_extraction.R Outdated Show resolved Hide resolved
@Qianyuxuan
Copy link
Collaborator Author

Qianyuxuan commented Oct 4, 2022 via email

@serbinsh
Copy link
Member

serbinsh commented Oct 6, 2022

Looks like reshape2 is indeed no longer a depends

[sserbin@modex data.land]$ grep -ri "reshape" .
./inst/FIA_allometry/README.Rmd:# Note: the "reshape" package is currently required, although this may
./inst/FIA_allometry/README.Rmd:library(reshape)
./inst/FIA_allometry/allometry.r:# Note: the "reshape" package is currently required, although this may
./inst/FIA_allometry/allometry.r:  #install.packages("reshape")
./inst/FIA_allometry/allometry.r:library(reshape)
./inst/FIA_allometry/biomass.r:# Note: the "reshape" package is currently required, although this may
./inst/FIA_allometry/biomass.r:library(reshape)
./DESCRIPTION:    reshape2,

but we still have some reshape requirements that could be updated at some point

@mdietze
Copy link
Member

mdietze commented Oct 6, 2022

@Qianyuxuan here are the most recent build errors.

 checking package dependencies ... NOTE: Imports includes 33 non-default packages.
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract: no visible binding for global variable 'name'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : cgamma: no visible global function definition for 'qgamma'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : fitQ: no visible global function definition for 'optim'

@serbinsh
Copy link
Member

serbinsh commented Oct 6, 2022

@Qianyuxuan here are the most recent build errors.

 checking package dependencies ... NOTE: Imports includes 33 non-default packages.
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract: no visible binding for global variable 'name'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : cgamma: no visible global function definition for 'qgamma'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : fitQ: no visible global function definition for 'optim'

@Qianyuxuan here are the most recent build errors.

 checking package dependencies ... NOTE: Imports includes 33 non-default packages.
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract: no visible binding for global variable 'name'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : cgamma: no visible global function definition for 'qgamma'
  checking R code for possible problems ... NOTE: soilgrids_soilC_extract : fitQ: no visible global function definition for 'optim'

So "qgamma" is an R base function yes, same with optim yes (well its stats::optim). Not sure what "name" is referring too

@serbinsh
Copy link
Member

serbinsh commented Oct 6, 2022

@mdietze in the current errors, I dont understand what check is referring to with

NOTE: soilgrids_soilC_extract: no visible binding for global variable 'name'

All I could find was in the docs

##' @name soilgrids_soilC_extract

Is that what its referring too?

@infotroph
Copy link
Member

Thanks! When I made the suggestion I may possibly have been forgetting that pivot_longer lived in tidyr instead of dplyr and therefore still meant adding a new dependency, but I like this change anyway :)

@mdietze mdietze merged commit 7fde8fb into PecanProject:develop Oct 8, 2022
@infotroph infotroph mentioned this pull request Jan 8, 2023
@Qianyuxuan Qianyuxuan deleted the soilgrids_extraction branch January 19, 2024 00:57
@Qianyuxuan Qianyuxuan restored the soilgrids_extraction branch January 19, 2024 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants