diff options
| author | Chris Sobczak <chris@sobczak.family> | 2026-07-06 16:37:25 -0700 |
|---|---|---|
| committer | Chris Sobczak <chris@sobczak.family> | 2026-07-06 16:37:25 -0700 |
| commit | 0515d6f8ed02671964146de96f578204c0490004 (patch) | |
| tree | ea6382a1b51f3340f4afc5a86d3f0c313a043ba6 /R/heatmap.R | |
| parent | c2900104450af73edbe8c0062593676f616033d6 (diff) | |
Fixmain
Diffstat (limited to 'R/heatmap.R')
| -rw-r--r-- | R/heatmap.R | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/R/heatmap.R b/R/heatmap.R index cf34d5f..1438fd3 100644 --- a/R/heatmap.R +++ b/R/heatmap.R @@ -29,13 +29,11 @@ heatmap <- function(R, title = NULL, labels = FALSE, order = NULL){ stop('Input must be coercible to a square matrix') } - cnames <- colnames(Rm) - rnames <- rownames(Rm) - if(is.null(cnames)){ - cnames <- as.character(seq_len(ncol(Rm))) + if(is.null(colnames(Rm))){ + colnames(Rm) <- as.character(seq_len(ncol(Rm))) } - if(is.null(rnames)){ - rnames <- as.character(seq_len(nrow(Rm))) + if(is.null(rownames(Rm))){ + rownames(Rm) <- as.character(seq_len(nrow(Rm))) } @@ -43,8 +41,6 @@ heatmap <- function(R, title = NULL, labels = FALSE, order = NULL){ if(length(order) != nrow(Rm)){ stop('Provided order is not the same length as the width of R') }else{ - rownames(Rm) <- rnames - colnames(Rm) <- cnames Rm <- Rm[order, order, drop = FALSE] } } |
