x <- rnorm(100,10,10)
cut(x,c(-Inf,0,5,6,10,Inf))
More Related Contents:
- How to reshape data from long to wide format
- Grouping functions (tapply, by, aggregate) and the *apply family
- Reshaping multiple sets of measurement columns (wide format) into single columns (long format)
- Select the row with the maximum value in each group
- How to create a consecutive group number
- Finding ALL duplicate rows, including “elements with smaller subscripts”
- Error in if/while (condition) {: missing Value where TRUE/FALSE needed
- Convert date-time string to class Date
- Why can’t R’s ifelse statements return vectors?
- Sample random rows in dataframe
- Extracting specific columns from a data frame
- Why do R objects not print in a function or a “for” loop?
- Converting year and month (“yyyy-mm” format) to a date?
- Fitting a density curve to a histogram in R
- A comprehensive survey of the types of things in R; ‘mode’ and ‘class’ and ‘typeof’ are insufficient
- What does %>% function mean in R?
- How do I install a package that has been archived from CRAN?
- as.Date with dates in format m/d/y in R
- How to order data by value within ggplot facets
- What’s the biggest R-gotcha you’ve run across?
- Logical operators (AND, OR) with NA, TRUE and FALSE
- Why is `vapply` safer than `sapply`?
- How to convert character of percentage into numeric in R
- How to subtract years?
- What is the difference between = and == in R?
- Should I use a data.frame or a matrix?
- Variable name restrictions in R
- Different legend-keys inside same legend in ggplot2
- Plot two graphs in a same plot
- R: How to split a data frame into training, validation, and test sets?