longest_consecutive: Calculate the longest consecutive giving streak

Description Usage Arguments Value

View source: R/longest_consecutive.R

Description

calculates the longest consecutive giving streak given giving details for constituents containing a fiscal year field

Usage

1
longest_consecutive(data, ids, fys, fy_range = NA, mode = "append")

Arguments

data

a data frame with donor ids and the fiscal year of gifts

ids

an unquoted column name that contains the constituent IDs

fys

an unquote column name that contains the fiscal year for gifts. If not present, run fy() or fy2().

fy_range

the maximum consecutive giving streak to try to find. By default, this uses the maximum range given the fiscal years provided.

mode

options for the output mode. By default, "append" creates a new data frame with all provided columns and the consecutive giving years column. There are two other options. "just_consecutive" will provide a table of IDs and values representing the longest consecutive giving streak. "summary" provides a count of donors for every consecutive giving value.

Value

a data frame of one out three possible options controlled by the value passed to the mode argument


crazybilly/fundRaising documentation built on July 30, 2021, 12:51 a.m.