Learn R Programming

SwimmeR (version 0.14.2)

na_pad: Pads shorter lists in a list-of-lists with NAs such that all lists are the same length

Description

Adds NA values to the end of each list in a list of lists such that they all become the length of the longest list. The longest list will not have any NAs added to it.

Usage

na_pad(x, y)

Value

a list of lists with each sub-list the same length

Arguments

x

a list of lists, with sub-lists having different lengths

y

a list of the number of NA values to append to each sub-list