discrete.Rd
discrete
creates a discrete vector which is distinct from a
continuous vector, or a factor/ordered vector.
The other function are tools for manipulating descrete vectors.
as.discrete(x, ...)
# Default S3 method
as.discrete(x, ...)
discrete(x, levels = sort(unique.default(x), na.last = TRUE), exclude = NA)
# S3 method for class 'discrete'
x[...] <- value
# S3 method for class 'discrete'
x[..., drop = FALSE]
# S3 method for class 'discrete'
x[[i]]
is.discrete(x)
# S3 method for class 'discrete'
is.na(x) <- value
# S3 method for class 'discrete'
length(x) <- value
as.discrete
converts a vector into a discrete vector.
discrete
creates a discrete vector from provided values.
is.discrete
tests to see if the vector is a discrete vector.
as.discrete
, discrete
returns a vector of
discrete
type.
is.discrete
returan logical TRUE
if the vector is of
class discrete other wise it returns FALSE
.
a <- discrete(1:25)
a
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#> attr(,"levels")
#> [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#> attr(,"class")
#> [1] "discrete"
is.discrete(a)
#> [1] TRUE
b <- as.discrete(2:4)
b
#> [1] 2 3 4
#> attr(,"levels")
#> [1] 2 3 4
#> attr(,"class")
#> [1] "discrete"