Giter Site home page Giter Site logo

Comments (2)

keithmeplz avatar keithmeplz commented on June 8, 2024 1

Hi Remi, thank you for your help. It works !

from rempsyc.

rempsyc avatar rempsyc commented on June 8, 2024

Thanks for opening an issue about this. Does the following meet your needs? Toy example below:

lm(mpg ~ cyl + wt * hp, mtcars) |>
  rempsyc::nice_lm() |>
  dplyr::mutate(p = insight::format_p(p, digits = "scientific2", name = NULL)) |>
  dplyr::rename(p_scientific = p) |>
  rempsyc::nice_table()

p_scientific


Explanation

As you figured, nice_table under the hood uses rempsyc::format_p, which does not handle scientific notation because it is designed only for APA style. However, insight::format_p (from easystats) does, so what we can do is use it to format the raw p values to scientific notation before feeding it to nice_table. However, nice_table only accepts a numeric variable called "p", so you will need to rename that variable since insight::format_p converts the values to character in order to have a stable scientific notation display.

You can manually rename the p_scientific column to only p if you wish so on the Word document once exported, but note that highlight = TRUE won't work since the p values have lost their numeric class.

from rempsyc.

Related Issues (14)

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.