public
mapobs
— function
mapobs(f, data)
Lazily map f
over the observations in a data container data
.
data = 1:10
getobs(data, 8) == 8
mdata = mapobs(-, data)
getobs(mdata, 8) == -8
mapobs(fs, data)
Lazily map each function in tuple fs
over the observations in data container data
.
Returns a tuple of transformed data containers.
mapobs(namedfs::NamedTuple, data)
Map a NamedTuple
of functions over data
, turning it into a data container
of NamedTuple
s. Field syntax can be used to select a column of the resulting
data container.
data = 1:10
nameddata = mapobs((x = sqrt, y = log), data)
getobs(nameddata, 10) == (x = sqrt(10), y = log(10))
getobs(nameddata.x, 10) == sqrt(10)