-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
based_on not working in @linq macro #48
Comments
Looks like only the iris=dataset("datasets", "iris")
@linq iris |> groupby(:Species) |> @based_on(x = mean(:SepalWidth)) But this syntax is probably better, right? @linq iris |> by(:Species, x=mean(:SepalWidth)) Or maybe I'm missing the difference between |
If you want to do transformations or calculations in between grouping and summarizing, a sand-alone speeds = @linq trajectory |>
group_by(:object) |>
transform(timespan = max(:t) - min(:t), displacement = last(:x) - first(:x)) |>
based_on(avg_speed = :displacement ./ :timespan) I this could of course all be done on one line, or by defining a helper function, but if you're working in the data-frame-piping style I think a separate |
👍 |
OK, I see. Though I don't understand the name: what is "based on" what in this operation? Isn't |
I believe the ideas is "based on this data frame, calculate these things." I'd tend to agree that (Prepare for the coming flame war over whether it should be |
I've been playing around with this package, and it's already made some of my real-world work a lot easier. I came across this error just now--
based_on
does not seem to work when chained together with other operations using@linq
.With R and dplyr, I can do the following:
but when I try the (I think?) equivalent in Julia, I get an error:
Is this something that should work? (Or am I doing something incorrectly?)
The text was updated successfully, but these errors were encountered: