Skip to content

Commit

Permalink
Optimize has_row_names. Fixes #634
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Jun 11, 2019
1 parent 593305c commit d25aad0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/utils.r
Expand Up @@ -143,8 +143,10 @@ data_uris <- function(..., mime = '', encoding = 'base64', files) {


has_row_names <- function(x) {
rns <- rownames(x)
length(dim(x)) != 1 && length(rns) > 0 && !all(rns == seq_len(nrow(x))) && !all(rns == '')
if (is.data.frame(x))
.row_names_info(x) > 0
else
!is.null(rownames(x))
}


Expand Down

1 comment on commit d25aad0

@flying-sheep
Copy link
Member Author

@flying-sheep flying-sheep commented on d25aad0 Dec 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.