Description Usage Arguments Examples
View source: R/data_wrangling.R
this function takes a subset of a dataset, omitting all cases with missings in variables specified in 'keep' and omitting all variables that still have missings after that. Good to see how large your dataset for a certain analysis will be and which covariates are 'free' in terms of sample size.
1 | take_nonmissing(df, keep = c())
|
df |
dataset |
keep |
defaults to empty vector |
1 2 3 4 5 6 | data(ChickWeight)
ChickWeight[1:2,c('weight','Chick')] = NA
ChickWeight[3:4,'Diet'] = NA
names(ChickWeight); nrow(ChickWeight)
ChickWeight2 = take_nonmissing(ChickWeight, keep = c('weight'))
names(ChickWeight2); nrow(ChickWeight2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.