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

ditto.list

Shorthand filler-inner for lists


Description

Suppose you want to set up a list where several consecutive elements take the same value, but you don't want to repeatedly type that value: then use dittolist to set empty (missing) elements to the previous non-empty element. Wrap in unlist() to create a vector instead of a list.

Usage

ditto.list(...)
# EG:
# ditto.list( a=1, b=, c='hello') # a: 1; b: 1, c: 'hello'

Arguments

...

anything, named or unnamed; missing elements OK

Value

List

Examples

unlist( ditto.list( a=1, b=, c='hello')) # a: 1; b: 1, c: 'hello'

mvbutils

Workspace Organization, Code and Documentation Editing, Package Prep and Editing, Etc

v2.8.232
GPL (>= 2)
Authors
Mark V. Bravington <mark.bravington@csiro.au>
Initial release
2018-12-11

We don't support your browser anymore

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