Skip to contents

is_in_need() function adds a new binary variable indicates if a score is above 3, which means: "in need", and is_in_acute_need() if a score is above 4, which means: "in acute need".

Usage

is_in_need(df, score, new_colname = NULL)

is_in_acute_need(df, score, new_colname = NULL)

Arguments

df

A dataframe.

score

The variable containing the score on a 1-5 scale.

new_colname

The name of the new column. If NULL, the function will create a new column with the name 'score_in_need'.