Таблица, отображаемая с использованием приведенного ниже кода, не отображается правильно для значений, которые меньше 1000. Значения больше 1000 выглядят так: (1,234)
, что я и ожидаю, а значения ниже 1000 выглядят так: 999.
---
title: "Untitled"
output: html_document
---
```{r setup}
knitr::opts_chunk$set(echo = TRUE)
library(knitr)
library(kableExtra)
dt <- data.frame(stringsAsFactors=FALSE,
test = c("a", "b", "c"),
header1 = c("(1,234)", "(999)", "(4,543)"),
header.2 = c("(1,674)", "(123)", "(4,423)"))
dt %>%
kable("html") %>%
kable_styling()
```
Есть ли простое исправление? Хранение скобок предпочтительнее.
> sessioninfo::session_info()
- Session info -----------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.6.1 (2019-07-05)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United Kingdom.1252
ctype English_United Kingdom.1252
tz Europe/London
date 2019-11-04
- Packages ---------------------------------------------------------------------------------------------------------------------------
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.6.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0)
[1] C:/Users/***********/Documents/R/R-3.6.1/library
> sessioninfo::session_info()
- Session info -----------------------------------------------------------------------------------------------------------------------
setting value
version R version 3.6.1 (2019-07-05)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United Kingdom.1252
ctype English_United Kingdom.1252
tz Europe/London
date 2019-11-04
- Packages ---------------------------------------------------------------------------------------------------------------------------
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.6.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
digest 0.6.22 2019-10-21 [1] CRAN (R 3.6.1)
evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0)
htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.6.0)
knitr 1.25 2019-09-18 [1] CRAN (R 3.6.1)
Rcpp 1.0.2 2019-07-25 [1] CRAN (R 3.6.1)
rmarkdown 1.15 2019-08-21 [1] CRAN (R 3.6.1)
rsconnect 0.8.15 2019-07-22 [1] CRAN (R 3.6.1)
rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.6.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.6.0)
xfun 0.9 2019-08-21 [1] CRAN (R 3.6.1)
yaml 2.2.0 2018-07-25 [1] CRAN (R 3.6.0)