Learn R Programming

SciencesPo (version 0.11.21)

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

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

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