From 61b275cbe9d461382d1ed18c9ffe5b7adec76126 Mon Sep 17 00:00:00 2001 From: Mehrad Mahmoudian Date: Wed, 17 Mar 2021 22:26:06 +0200 Subject: [PATCH] Fixed typo and improved wording in errors --- R/pheatmap.r | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/pheatmap.r b/R/pheatmap.r index 8c2e919..2a6b792 100644 --- a/R/pheatmap.r +++ b/R/pheatmap.r @@ -405,7 +405,7 @@ heatmap_motor = function(matrix, border_color, cellwidth, cellheight, tree_col, jpg = function(x, ...) jpeg(x, units = "in", res = 300, ...), tiff = function(x, ...) tiff(x, units = "in", res = 300, compression = "lzw", ...), bmp = function(x, ...) bmp(x, units = "in", res = 300, ...), - stop("File type should be: pdf, png, bmp, jpg, tiff") + stop("File type should be either of: pdf, png, bmp, jpg, tiff") ) # print(sprintf("height:%f width:%f", height, width)) @@ -537,7 +537,7 @@ cluster_mat = function(mat, distance, method){ stop("clustering method has to one form the list: 'ward', 'ward.D', 'ward.D2', 'single', 'complete', 'average', 'mcquitty', 'median' or 'centroid'.") } if(!(distance[1] %in% c("correlation", "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski")) & class(distance) != "dist"){ - stop("distance has to be a dissimilarity structure as produced by dist or one measure form the list: 'correlation', 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary', 'minkowski'") + stop("distance has to be a dissimilarity structure as produced by dist or one measure form the list: 'correlation', 'euclidean', 'maximum', 'manhattan', 'canberra', 'binary', 'minkowski'") } if(distance[1] == "correlation"){ d = as.dist(1 - cor(t(mat))) @@ -562,7 +562,7 @@ scale_rows = function(x){ scale_mat = function(mat, scale){ if(!(scale %in% c("none", "row", "column"))){ - stop("scale argument shoud take values: 'none', 'row' or 'column'") + stop("scale argument should take values: 'none', 'row' or 'column'") } mat = switch(scale, none = mat, row = scale_rows(mat), column = t(scale_rows(t(mat)))) return(mat)