range_as_mean: A function to convert a range of values into their mean

View source: R/range_as_mean.R

range_as_meanR Documentation

A function to convert a range of values into their mean

Description

This function allows you to convert each range into their mean, even if it has string elements, make sure your delete any don't wanted numbers in the range.

Usage

range_as_mean(df, vars)

Arguments

df

The dataframe containing the variables you want to changes.

vars

a variable (or vector of variables) quoted that you want to change from a range to their mean.

Value

The mean of vars.

Examples

range_as_mean(df, "salary")

samesag/emu documentation built on Aug. 22, 2023, 3:19 p.m.