## ---- include = FALSE---------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(mStats)
## -----------------------------------------------------------------------------
x <- 1:5
x
## ---- eval=FALSE--------------------------------------------------------------
# cut(x, NA)
# cut(x, 1)
## -----------------------------------------------------------------------------
cut(x, 2)
cut(x, 5)
cut(x, c(3, 5))
## -----------------------------------------------------------------------------
cut(x, c(-Inf, 2, Inf))
## -----------------------------------------------------------------------------
cut(x, 1:5)
## ---- eval=FALSE--------------------------------------------------------------
# cut("x", 1)
## -----------------------------------------------------------------------------
x <- Sys.Date() - 1:5
x
cut(x, 2)
## -----------------------------------------------------------------------------
x <- Sys.time() - 1:5
x
cut(x, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.