Coder Social home page Coder Social logo

Comments (6)

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024 1

The function also needs to be renamed to simplifyFragmentData--note the missing "i" in the current function name.

from soildb.

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024

Note that issues related to fragment content >100% aren't always data errors, they can be related to multiple pedons / KSSL data source (c/o Brian Gardner):

HI Dylan,

As you recall I was coming up with erroneously high frag contents in some horizons on Kettenbach series. After a closer look, it seems like the function is being confused because for this series there are two pedons per site. As is practice we have one pedon owned by KSSL that remains unchanging and a second owned by the SSO that is updateable. The updateable one is checked as 'representative pedon'.

This creates a situation where there are two horizons in NASIS with the same horizon labsample number. A quick look at horizons where frags were less than 100% showed several that were still double what was recorded for the horizon in NASIS (for each individual pedon/horizon)

Maybe this is the source of the problem?

from soildb.

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024

This function should also allow for custom specification of fragment classes as an argument.

from soildb.

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024

Function re-named with backwards compatibility in e2b237d.

from soildb.

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024

Another small issue, simplifyFragmentData fails when passed a single row with null fragvol:

d <- structure(list(phiid = 1386592L, fragvol = NA_real_, fragsize_l = NA_integer_, 
    fragsize_r = NA_integer_, fragsize_h = NA_integer_, fragshp = structure(NA_integer_, .Label = c("flat", 
    "nonflat"), class = "factor"), fraghard = structure(NA_integer_, .Label = c("noncemented", 
    "indurated", "moderately cemented", "strongly cemented", 
    "weakly cemented", "extremely weakly", "very weakly", "very strongly", 
    "weakly", "moderately", "strongly", "extremely strong", "H", 
    "S"), class = "factor")), .Names = c("phiid", "fragvol", 
"fragsize_l", "fragsize_r", "fragsize_h", "fragshp", "fraghard"
), row.names = 1049L, class = "data.frame")

simplifyFragmentData(d, 'phiid')
Error: value.var (volume) not found in input
In addition: Warning message:
 Error: value.var (volume) not found in input 

This is a data population issue, consider pre-filtering rows without data.

from soildb.

dylanbeaudette avatar dylanbeaudette commented on June 2, 2024

Filtering solves the problem but we are now left with the issue of NA vs. 0 when there are no records in the phfrags table.

from soildb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.