GithubHelp home page GithubHelp logo

GT table formatting about pagedown HOT 3 CLOSED

JFern83 avatar JFern83 commented on June 3, 2024
GT table formatting

from pagedown.

Comments (3)

cderv avatar cderv commented on June 3, 2024 1

Do you see this only with pagedown output ? Or is it the same output in R console when you run the gt code ?

Why open the issue in this repo ? Your example does not even use pagedown.

You have some Q&A forum dedicated to generic question (like https://community.rstudio.com/). Wouldn't it be better to ask there for gt community to help ?

from pagedown.

JFern83 avatar JFern83 commented on June 3, 2024 1

Yes apologies, new to Github and think I've posted this issue in the wrong place! The general Q&A forum looks much more appropriate.

If interested, it is in the R console that the problem occurred, but by adding ungroup prior to passing to gt() the problem was resolved.

from pagedown.

JFern83 avatar JFern83 commented on June 3, 2024
final_table <- df %>% 
  group_by(Unit, Course) %>% 
  summarise_at(.vars = c("RR", "Score"), .funs = ~mean(., na.rm = T)) %>% 
  arrange(desc(Score)) %>% 
  gt() %>% 
  cols_label(
    RR = ("Response Rate %"), 
    Score = "Mean Score") %>% 
  opt_align_table_header(align = "left") %>% 
  fmt_number(columns = Score) %>% 
  fmt_number(columns = RR, scale_by = 100/1, decimals = F) %>% 
  cols_width(
    Unit ~ px(150),
    RR ~px(150),
    Score ~px(150)) %>% 
  cols_align("center") %>% 
  data_color(
    columns = Score, 
    colors = scales::col_numeric(
      palette = c(
        "red","orange","green"),
             domain = c(3,3.5,4.0,4.5,5)))
#> Error in df %>% group_by(Unit, Course) %>% summarise_at(.vars = c("RR", : could not find function "%>%"

Created on 2023-07-08 with reprex v2.0.2

from pagedown.

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.