Skip to content

Commit 5bd07d9

Browse files
committed
quicksummary now returns a data frame
1 parent 422af24 commit 5bd07d9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/Percent.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#' Percent(Data = Data, Type = "Value") # Value, Frame
2323
#' Percent(Data = sample, Type = "Frame") # Value, Frame
2424
Percent <- function(Data, Type, format = "f", ...){
25+
options(scipen = 999, digits = 2)
2526
if (Type == "Value") {
2627
percent <- Data
2728
Rate <- (percent/percent)*100
@@ -31,9 +32,9 @@ Percent <- function(Data, Type, format = "f", ...){
3132
if(is.null(dim(percent))){
3233
Rate <- percent/sum(percent)*100
3334
percent <- paste0(formatC((percent/sum(percent))*100, format = format,
34-
digits = digits, ...), "%")
35+
...), "%")
3536
}else{
36-
Data <- signif(sweep(Data, 2, colSums(Data), FUN = "/")*100, 2)
37+
Data <- sweep(Data, 2, colSums(Data), FUN = "/")*100
3738
percent <- Rate <- as.data.frame(as.matrix(Data))
3839
HI <- nrow(percent)
3940
GI <- ncol(percent)

R/quicksummary.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,5 @@ quicksummary <- function (x, Type, Cut, Up, Down, ci = 0.95){
9797
} else {
9898
ans = ans
9999
}
100-
ANS <- knitr::kable(ans, row.names = TRUE, "html")
101-
kableExtra::kable_styling(ANS, "striped", position = "center")
100+
ans
102101
}

0 commit comments

Comments
 (0)