Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

full_seq

Create the full sequence of values in a vector


Description

This is useful if you want to fill in missing values that should have been observed but weren't. For example, full_seq(c(1, 2, 4, 6), 1) will return 1:6.

Usage

full_seq(x, period, tol = 1e-06)

Arguments

x

A numeric vector.

period

Gap between each observation. The existing data will be checked to ensure that it is actually of this periodicity.

tol

Numerical tolerance for checking periodicity.

Examples

full_seq(c(1, 2, 4, 5, 10), 1)

tidyr

Tidy Messy Data

v1.1.3
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.