Calculate the fraction (univariate case) or fractions (bivariate case) of missing values in the data or in each component of the data.
nafracCalc(y,drop=TRUE)
If y
is not of class "multipleHmmDataSets"
,
then the returned value is a scalar (between 0 and 1) if the data
are univariate or a pair (2-vector) of such scalars if the data
are bivariate. The values are equal to the ratios of the total
count of missing values in the appropriate column to the total
number of observations.
If y
is of class "multipleHmmDataSets"
,
and if y
has length greater than 1 or drop
is
FALSE
, then the returned value is a list of such
scalars or 2-vectors, each corresponding to one of the data sets
constituting y
. If y
has length equal to 1 and
drop
is TRUE
, then the returned value is the same
as if codey were not of class "multipleHmmDataSets"
.
A vector or a one or two column matrix of discrete data or a
list of such vectors or matrices, or a list of such lists
(an object of class "multipleHmmDataSets"
such as might
be produced by rhmm()
).
Logical scalar. If y
is of class
"multipleHmmDataSets"
but actually consists of a
single data set, and if drop
is TRUE
, then the
returned value is not a list but rather the single component
that such a list “would have had” were drop
equal
to FALSE
. This argument is ignored if y
is not of
class "multipleHmmDataSets"
or has length greater than 1.
Rolf Turner
r.turner@auckland.ac.nz
rhmm()
misstify()
xxx <- with(SydColDisc,split(y,f=list(locn,depth)))
nafracCalc(xxx) # 0.7185199
Run the code above in your browser using DataLab