cut_fast | R Documentation |
This function is a fast version of cut that will put every element of x in one of the intervals created by breaks.
cut_fast(x = c(), breaks = c())
x |
Numeric vector of elements to put into segments |
breaks |
Numeric vector of breaks |
Each interval is left closed and right opened, example: '[0,1)'.
If -Inf or/and +Inf are not in the vector 'breaks', it will be added to it.
If none of the elements are out of the intervales between the breaks, then the factor returned is only constituted of the breaks intervals. Else, +/-Inf will be added.
factor of intervals
cut_fast(c(0,0.2,3,5),c(0,1,2,3,4)) #will contain +Inf
cut_fast(c(0,0.2,3),c(0,1,2,3,4)) #will only contain the specific intervals
cut_fast(c(-1,0.2,3),c(0,1,2,3,4)) #will contain -Inf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.