[R] Error in cut.default(a, breaks = 100) : 'breaks' are not unique
yoyohashao at qq.com
Wed Feb 17 16:06:19 CET 2016
Dear R users,
as my first post for this mailing list, I'd like to ask questions about 'break' in cut.default.
I am using pheatmap in RStudio. Pheatmap is a function to draw clustered heatmap in R.
According to the manual, breaks is 'a sequence of numbers that covers the range of values in data matrix and is one element longer than color vector. Used for mapping values to colors. Useful, if needed to map certain values to certain colors, to certain values. If value is NA then the breaks are calculated automatically.'
I left it NA but received an error message. I then assigned a seq to it by typing breaks=c(0,1,2,3,4,5,6,7,8,9), which didn't work as well (my col.pal has 9 elements so I made a breaks with 10 elements).
One thing I felt confused was that it said breaks should cover the range of values in data matrix. My data has 20 obs. of 23 variables. Which number would cover it? And how should I understand 'cover' in this context.
Sorry to bother you guys. I am quite a rookie to R.
[[alternative HTML version deleted]]
More information about the R-help