50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

COMBO (version 1.1.0)

sum_every_n1: Sum Every "n"th Element, then add 1

Description

Sum Every "n"th Element, then add 1

Usage

sum_every_n1(x, n)

Value

sum_every_n1 returns a vector of sums of every nth element of the vector x, plus 1.

Arguments

x

A numeric vector to sum over

n

A numeric value specifying the distance between the reference index and the next index to be summed