Learn R Programming

SciencesPo (version 1.02.12)

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
data(us2012)
psum(us2012$Obama, us2012$Romney)
swingy <-psum(us2012$Obama, us2012$Romney-100)

Run the code above in your browser using DataLab