[R] Error in cut.default(a, breaks = 100) : 'breaks' are not unique

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Wed Feb 17 21:33:09 CET 2016


Range of values is a standard mathematical concept, unrelated to the number of values in your data set.  Consider using the summary function to learn about the range of your data. 

Also, read the Posting Guide (which warns you to use pain text in formulating your emails to the list to avoid corruption of your email). Always try to supply self-contained examples of code that conveys what you understand so far. Read http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for advice on communicating examples clearly. 
-- 
Sent from my phone. Please excuse my brevity.

On February 17, 2016 7:06:19 AM PST, "/ty放仔兽/yl" <yoyohashao at qq.com> wrote:
>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.
>
>
>Kind. Sebastian
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

	[[alternative HTML version deleted]]



More information about the R-help mailing list