Learn R Programming

packDAMipd (version 0.2.0)

get_mean_sd_age: Function to return mean age from a data frame

Description

Function to return mean age from a data frame

Usage

get_mean_sd_age(this_data, age_nrcode)

Arguments

this_data

the data containing column with age

age_nrcode

non response code

Value

mean and sd, if success -1, if failure

Details

Age data is complete with the nr code given and get the mean and sd

Examples

Run this code
# NOT RUN {
this_data <- as.data.frame(cbind(num = c(1, 2, 3, 4),
age = c(14, 25, 26, 30)))
get_mean_sd_age(this_data, NA)
# }

Run the code above in your browser using DataLab