as.vector,HistDat-method {HistDat} | R Documentation |
Converts this histogram to a vector. Not recommended if there are many counts as this would result in an incredibly long vector
Description
Converts this histogram to a vector. Not recommended if there are many counts as this would result in an incredibly long vector
Usage
## S4 method for signature 'HistDat'
as.vector(x)
Arguments
x |
An instance of the class HistDat |
Value
A vector with the same length
as x
, but as a 1-D vector with
an element for each count in the counts vector. In other words, all
length(x)
observations will be represented as a single element instead of
being just counted as in the original HistDat object.
Examples
hd <- HistDat(vals = 1:3, counts = c(1, 2, 1))
as.vector(hd) # returns 1 2 2 3
[Package HistDat version 0.2.0 Index]