Git Product home page Git Product logo

Comments (5)

TIMAVID avatar TIMAVID commented on September 23, 2024

This issue is not present when I revert to gratia version 0.8.1

from gratia.

rbentham avatar rbentham commented on September 23, 2024

Hi,

I have also encountered this issue. I maintain a package that has a dependency on gratia (https://github.com/McGranahanLab/TcellExTRECT) besides the changing of the column names of confint.gam in 0.9.0 I am now getting different results compared to previous version. I have tested this and it is due to this issue of shift = TRUE not being functional within confint.gam from 0.9.0.

The code for confint.gam in gratia 0.8.2 included the following:

out[["est"]] <- ilink(out[["est"]] + const)
out[["lower"]] <- ilink(out[["lower"]] + const)
out[["upper"]] <- ilink(out[["upper"]] + const)

In gratia 0.9.0 this has changed to:

 out <- mutate(out, across(all_of(c(".estimate", ".lower_ci",
        ".upper_ci")), .fns = ilink))

With no reference to the const value and no shift in values even when shift = TRUE. This could be easily fixed if you just replaced the above with something similar to the old version:

out[[".estimate"]] <- ilink(out[[".estimate"]] + const)
out[[".lower_ci"]] <- ilink(out[[".lower_ci"]] + const)
out[[".upper_ci"]] <- ilink(out[[".upper_ci"]] + const)

from gratia.

gavinsimpson avatar gavinsimpson commented on September 23, 2024

Yeah, sorry @TIMAVID and @rbentham; I messed that up. And sorry @TIMAVID for not getting to this sooner, even to acknowledge it (it's been a very busy month at work).

The problem is not in the lines of code you mention @rbentham but here

gratia/R/confint-methods.R

Lines 417 to 420 in b03e7d5

out <- add_column(out,
.lower_ci = out$.estimate - (out$.crit * out$.se),
.upper_ci = out$.estimate + (out$.crit * out$.se)
)

As far as I can tell, the mutate() call is doing what it is supposed to do, namely transform the using either the inverse link function, a user-supplied function, or the identity function, depending on what's passed to transform. I'm testing a fix now.

@rbentham Is this causing you problems with a package on CRAN? If so I can expedite a patch release to CRAN.

from gratia.

gavinsimpson avatar gavinsimpson commented on September 23, 2024

This is now fixed in the development version. I'm unlikely to get a version pushed to CRAN before middle of June unless it becomes very necessary for me to do so.

from gratia.

rbentham avatar rbentham commented on September 23, 2024

@gavinsimpson Thanks for the quick response! My package is not on CRAN/Bioconductor which makes things a bit simpler to deal with. I am going to add this as a known issue to my package, and wait for the CRAN update to implement my fix to the confint.gam column names. Currently the change of column names results in an error to the relevant function so that the shift=TRUE issue does not even happen. When the latest version is out on CRAN I will add the fix and a new dependency to use the latest gratia version.

from gratia.

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.