SciencesPo (version 1.3.8)

psum: Parallel sum

Description

Provides parallel sum like pmin and pmax from the base package. The function sum simply does not help when the objective is to obtain a vector with parallel sum rather than a scalar value.

Usage

psum(..., na.rm = FALSE)

Arguments

na.rm
A logical value TRUE or FALSE, the default
...
One or more unit objects

Value

  • A vector containing the parallel sum.

encoding

UTF-8

Examples

Run this code
n <- 20
mydat <- data.frame(PT = rnorm(n, mean = .30),
PSDB = rnorm(n, mean = .25), PSB = rnorm(n, mean = .15))
transform(mydat, DK = psum(PT, PSDB, PSB - 1))

Run the code above in your browser using DataCamp Workspace