TidierOrg / TidierData.jl

Tidier data transformations in Julia, modeled after the dplyr/tidyr R packages.
MIT License
86 stars 7 forks source link

Add support to functions within `@slice()` #31

Closed kdpsingh closed 10 months ago

kdpsingh commented 1 year ago

Right now, this doesn't work as a way to shuffle the rows.

using TidierData
using StatsBase

@chain df begin
  @slice(sample(1:n(), n())
end

There are two issues here:

We need to support functions within @slice(). We may also want to define a local function n() within the @slice() macro that returns nrow() to ensure that n() can be used in functions inside of @slice().

This is not an immediate priority but we should come back to this because it may allow for a simpler implementation of @slice_sample() in the future.

kdpsingh commented 10 months ago

This is fixed in #75.