Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rowsums.n

Get Row Sums With N Missing Values Per Row


Description

Does what furniture::rowsums() does while allowing a certain number (n) to have missing values.

Usage

rowsums.n(..., n)

Arguments

...

the variables (unquoted) to be included in the row means

n

the number of values without missingness required to get the row mean

Value

the row sums

Examples

## Not run: 

library(furniture)
library(dplyr)

data <- data.frame(
  x = sample(c(1,2,3,4), 100, replace=TRUE),
  y = rnorm(100),
  z = rnorm(100)
)

data2 <- mutate(data, x_y_z_mean = rowsums.n(x, y, z, n = 2))


## End(Not run)

furniture

Furniture for Quantitative Scientists

v1.9.10
GPL-3
Authors
Tyson S. Barrett [aut, cre] (<https://orcid.org/0000-0002-2137-1391>), Emily Brignone [aut], Daniel J. Laxman [aut]
Initial release
2021-02-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.