
Calculate Average Number of Active Needles
Source:R/add_average_active_needles.R
add_average_active_needles.Rd
Computes the average number of active needles across all fractions for each subject. Identifies columns containing fraction-specific active needle counts and calculates their mean value.
Value
The input data frame with an additional column `average_nr_active_needles` containing the rounded average. NaN values are converted to NA.
Examples
if (FALSE) { # \dontrun{
df <- data.frame(fraction_1_active_needles = c(1, 2, 3),
fraction_2_active_needles = c(3, 4, 5),
some_other_column = c('a', 'b', 'c'))
average_active_needles(df)
} # }