Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formattable package + DT package error. #72

Open
lovetoken opened this issue Jul 9, 2016 · 1 comment
Open

formattable package + DT package error. #72

lovetoken opened this issue Jul 9, 2016 · 1 comment

Comments

@lovetoken
Copy link

Hi! I am a Korean (Please note that do not speak English well.) & basic R user.
I really thank you for providing the package.
By the way, I found an error today while using formattable, dplyr and DT packages.
Here the example R code.

library(dplyr)
library(DT)

d <- data.frame(V1=rnorm(10, 10^6), V2=seq(0.1, 1, 0.1))

ready to the example data.frame object the d.
(Also load packages dplyr, DT)

using scales package case

library(scales)
d_scales <- d %>% mutate(V1=comma(V1), V2=percent(V2))
datatable(d_scales) # Good result

I want result that.
But using formattable package case

detach("package:scales")
library(formattable)
d_format <- d %>% mutate(V1=comma(V1), V2=percent(V2))
datatable(d_format) # Bad

datatable result don't apply format accounting and percentize.
How i can see the applied format result on datatable?

Thank you for reading the question.

@renkun-ken
Copy link
Owner

At the moment, you may try installing formattable v0.2:

# install.packages("devtools")
devtools::install_github("renkun-ken/formattable@v0.2")

and call as.datatable with

as.datatable(formattable(d_format))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants