cfhammill / lenses

Elegant Data Manipulation with Lenses
https://cfhammill.github.io/lenses
Other
27 stars 4 forks source link

Assignment into empty filter_l #33

Open arbelt opened 5 years ago

arbelt commented 5 years ago

Assigning to a composed filter_l + index_l generates an error. Seems that assigning into an empty subset and assigning into an empty dataframe are handled differently, e.g.,

# for empty index i
d[i,cols] <- NA  # works
d[i,][,cols] <- NA  # doesn't work

Submitted a simple PR — #32 — to perform the assignment only if the set of rows is non-empty.