Description Usage Arguments Value See Also Examples
View source: R/quest_functions.R
ncases
counts how many cases in a data.frame there are that have
a specified frequency of observed values across a set of columns. This function
is similar to nrow
and is essentially partial.cases
+ sum
. The user
can have ncases
return the number of complete cases by calling ov.min = 1
,
prop = TRUE
, and inclusive = TRUE
(the default).
1 
data 
data.frame or matrix of data. 
vrb.nm 
a character vector of colnames from 
ov.min 
minimum frequency of observed values required per row. If

prop 
logical vector of length 1 specifying whether 
inclusive 
logical vector of length 1 specifying whether the case should
be included if the frequency of observed values in a row is exactly equal to 
integer vector of length 1 providing the nrow in data
with the given amount of observed values.
1 2 3 4 5  vrb_nm < c("Ozone","Solar.R","Wind")
nrow(airquality[vrb_nm]) # number of cases regardless of missing data
sum(complete.cases(airquality[vrb_nm])) # number of complete cases
ncases(data = airquality, vrb.nm = c("Ozone","Solar.R","Wind"),
ov.min = 2/3) # number of rows with at least 2 of the 3 variables observed

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.