Git Product home page Git Product logo

Comments (5)

Jaeoc avatar Jaeoc commented on August 19, 2024 1

Hi, just tried it out, and now it works nicely. Appreciate the quick fix :)

from kableextra.

haozhu233 avatar haozhu233 commented on August 19, 2024

Hi, @Jaeoc, thanks for reporting this bug. In fact, I just fixed a very similar bug last night which causes similar behavior when you have symbols like % present. Can you try to re-install from github and let me know if this bug has gone away?

from kableextra.

Jaeoc avatar Jaeoc commented on August 19, 2024

Hi,

it seems like I was mistaken with what the cause of the problem was. I fiddled around with the mtcars dataset to try to reproduce the issue, and it seems to have to do with the structure of the dataframe used for the table. In my original table I had some variables where I'd used paste0 to create columns with two values, one being in parentheses, like so: "3452 (3.2)". It appears that for those rows where this is the case, the group_rows function does not work. The code below reproduces this for the mtcars dataset. Not sure what the problem is exactly though, since there is no problem if I just force a column to be a factor or character value...

library(knitr)
library(kableExtra)
for (i in 1:nrow(mtcars)) {
  mtcars$hp[i] <- paste0(mtcars$hp[i], " (", 1, ")")
}
kable(head(mtcars, n = 20), caption = "test", booktabs = T) %>%
  kable_styling() %>%
  group_rows("these rows", 4, 16) %>%
  group_rows("Those rows", 17,20)

from kableextra.

haozhu233 avatar haozhu233 commented on August 19, 2024

I see. I just reproduced the error. I know where the problem is but the fix is a little tricky. I'll see what I can do.

from kableextra.

haozhu233 avatar haozhu233 commented on August 19, 2024

Hi, @Jaeoc, I just fixed the bug. Do you want to try out the latest github version and let me know the results?

from kableextra.

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.