bloodpress_mean: Calculate the mean blood pressure

Description Usage Arguments Value See Also Examples

View source: R/bloodpress-functions.R

Description

functions that given a data.frame and columns selection in argument 'cols' using tidy selectors, will calculate the mean

Usage

1
bloodpress_mean(data, cols, na.rm = TRUE)

Arguments

data

data frame

cols

columns selected with tidy selectors

na.rm

logical. Should missing values (including NaN) be omitted from the calculations?

Value

numeric vector with mean

See Also

Other blood pressure functions: bloodpress_map()

Examples

1
2
3
4
5
6
7
8
9
  dt <- data.frame(
  BloodPress_Diastolic_1 = c(80,32,66,NA),
  BloodPress_Diastolic_2 = c(58,45,NA,99),
  BloodPress_Systolic_1 = c(40,NA,80,120),
  BloodPress_Systolic_2 = c(NA, 65,45,100)
  )
  
  bloodpress_mean(dt, dplyr::contains("Diastolic"))
  bloodpress_mean(dt, dplyr::contains("Systolic"))

LCBC-UiO/Conversions documentation built on Dec. 19, 2020, 5:28 a.m.