-
Notifications
You must be signed in to change notification settings - Fork 373
Closed
Description
Currently combine special cases nrow to get the number of rows.
It's actually pretty hard to get the percentage of observations in a group when doing a combine operation. You have to do nrow before, then save that variable, then make a new nrow.
It might be worth considering adding something like
julia> df = DataFrame(
sex = rand(["Man", "Woman", "Other"], 100),
race = rand(["White", "Black", "Other"], 100),
income = rand(100));
julia> combine(groupby(df, "race"), percentage)
be a shorthand for
N = nrow(parent(df))
n = nrow(sdf)
return n / N