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

just a proposition to have tables with ordered levels #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions R/modules-constructors.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ ModuleCreateTableForOneVar <- function(x) { # Give a vector

## Reorder variables
freq <- freq[c("n","miss","p.miss","level","freq","percent","cum.percent")]

## Ordering the levels of the categorical variable in the loop
ord = order(freq$percent,decreasing = TRUE)
## ordreing the table of the categorical variable
freq = freq[ord,]

## Return result as a data frame
return(freq)
Expand Down