You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to preserve "reorder" row names when sorting in na_summary.
Similar Features
This is related to na_summary when sorted.
Feature Details
Given a data.frame object, running na_summary on this data works as expected except the returned rows are in their original order. Example:
df <- data.frame(A=1:5,B=c(NA,NA,25,24,53), C=c(NA,1,2,3,4))
na_summary(df,sort_by="variable",descending=TRUE)
variable missing complete percent_complete percent_missing
3 C 1 4 80 20
2 B 2 3 60 40
1 A 0 5 100 0
In the above result, we could instead change 3 to 1 to 1 to 3 as per the new numbering.
Proposed Implementation
Change row.names to 1:nrow(df). This might be fine for numeric rownames but not non-numeric indices. Say we had some names, it might be problematic to change these to numeric indices. Perhaps add a warning/argument to ask users what they would like to do with the indices?
The text was updated successfully, but these errors were encountered:
Description
I would like to preserve "reorder" row names when sorting in
na_summary
.Similar Features
This is related to
na_summary
when sorted.Feature Details
Given a
data.frame
object, runningna_summary
on this data works as expected except the returned rows are in their original order. Example:In the above result, we could instead change 3 to 1 to 1 to 3 as per the new numbering.
Proposed Implementation
Change
row.names
to1:nrow(df)
. This might be fine for numericrownames
but not non-numeric indices. Say we had some names, it might be problematic to change these to numeric indices. Perhaps add a warning/argument to ask users what they would like to do with the indices?The text was updated successfully, but these errors were encountered: