Comments (6)
think its simpler to leave within the function - people can then also use the funciton outside of an rmd if wanted.... just my reasoning but happy to be corrected!
I see these functions as helpers for calculating a certain value. These can be used for displaying tables, but can also be used for plotting and direct comparison. In the Rmarkdown document, we display the tables through kable()
, which already has its own rounding facilities.
Besides, since the function returns a tibble, the rounding is not necessary even for those who don't use kable()
since tibbles only print the significant digits by default.
Also more explaining to do if have to specify in options and in kable the num digits wanted...
I messed up the explanation here. The only thing that would be done is to move the digits argument to kable()
, no messing around with options.
from sitrep.
I just found out that the digits option is different from the digits
specification in knitr kables
x <- tibble::enframe(runif(3) + 69)
knitr::kable(x, caption = "default: prints 7 digits")
name | value |
---|---|
1 | 69.71135 |
2 | 69.97812 |
3 | 69.25433 |
options(digits = 2)
knitr::kable(x, caption = "options(digits = 2)")
name | value |
---|---|
1 | 70 |
2 | 70 |
3 | 69 |
options(digits = 7)
knitr::kable(x, digits = 2, caption = "options(digits = 7); kable(x, digits = 2)")
name | value |
---|---|
1 | 69.71 |
2 | 69.98 |
3 | 69.25 |
Created on 2019-01-22 by the reprex package (v0.2.1)
from sitrep.
think its simpler to leave within the function - people can then also use the funciton outside of an rmd if wanted.... just my reasoning but happy to be corrected!
Also more explaining to do if have to specify in options and in kable the num digits wanted...
from sitrep.
I am a bit indifferent, not sure what is easier for folks.
from sitrep.
cool beans
from sitrep.
closed by #42
from sitrep.
Related Issues (20)
- surveys gtsummary wrapper HOT 1
- fix survey gtsummary::inline_text
- add msf_dict_rename_helper() to surveys HOT 1
- review zcurve() function
- add a decision tree overview of rmd structure
- discuss {rnssp-rmd-templates}
- fix {sitrep} re-exports HOT 1
- shift templates to quarto HOT 1
- move to r-universe
- update google analytics tags
- finalising {gtsummary} wrappers
- put geom_event() function in {epikit} HOT 1
- find_start_date defaults
- languages {pkgdown} website
- r-opensci package peer review
- add tests for data imports HOT 1
- tidyverse updates
- sitrep logo
- final steps
- separate re-coding script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sitrep.