Learn R Programming

healthcareai (version 1.2.4)

percentDataAvailableInDateRange: Find the percent of a column that's filled

Description

Shows what percentage of data is avilable (potentially within a specified date range)

Usage

percentDataAvailableInDateRange(df, dateColumn = NULL,
  startInclusive = NULL, endExclusive = NULL)

Arguments

df

A dataframe

dateColumn

Optional string representing a date column of interest

startInclusive

Optional string in the in this date style: 'YYYY-MM-DD'

endExclusive

Optional string in the in this date style: 'YYYY-MM-DD'

Value

A labeled numeric vector, representing each column in input df

References

http://healthcareai-r.readthedocs.io

See Also

healthcareai

Examples

Run this code
# NOT RUN {
df <- data.frame(a = c(1,2,NA,NA),
                 b = c('m','f','m','f'),
                 c = c(0.7,NA,2.4,-4),
                 d = c(100,300,200,NA),
                 e = c(400,500,NA,504),
                 datecol = c('2012-01-01','2012-01-02',
                             '2012-01-03','2012-01-07'))

out <- percentDataAvailableInDateRange(df = df, # <- Only required argument
                                       dateColumn = 'datecol',
                                       startInclusive = '2012-01-01',
                                       endExclusive = '2012-01-08')
out
# }

Run the code above in your browser using DataLab