Elegant Data Manipulation with Lenses
Construct a lens into an attribute
Attributes lens
Body lens
Convenient lens composition
Class lens
A lens into the column names of an object
Column lens
Conditional lens
Lens into the diagonal of a matrix
Dims lens
Dimnames lens
Conditional trim lens
Environment lens
Filter lens
Filter lens
A lens into the first element
Formals lens
The identity (trivial lens)
Construct a lens into an index/name
Construct a lens into a subset of an object
A lens into the last element
Compose lenses
Construct a lens
Levels lens
Lens into lower diagonal elements
Promote a lens to apply to each element of a list
A lens into the names of an object
Bind data to a lens
Map a function over a lens
Map a function over a list lens
Map a function over an in scope lens
Pipe operator
Lens into a new dimension(s)
Reverse lens
A lens into the row names of an object
Row lens
Tidyselect elements by name
Set one lens to the view of another
Set one lens to the view of another (transformed)
Modify data with a lens
Slab lens
Slice lens
Slot lens
Matrix transpose lens
Construct a lens into a prefix of a vector
Conditional head lens
Promote a function to a getter
lens
Lens into a list of rows
Unlist lens
Lens into upper diagonal elements
View data with a lens
Provides tools for creating and using lenses to simplify data manipulation. Lenses are composable getter/setter pairs for working with data in a purely functional way. Inspired by the 'Haskell' library 'lens' (Kmett, 2012) <https://hackage.haskell.org/package/lens>. For a fairly comprehensive (and highly technical) history of lenses please see the 'lens' wiki <https://github.com/ekmett/lens/wiki/History-of-Lenses>.
Useful links