-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
I came across this issue while writing some examples for TidierPlots. It may be that I'm just doing something wrong, but this code:
df_h = @chain penguins begin
@group_by(species)
@summarize(
mean_bill = mean(bill_length_mm),
se_bill = std(bill_length_mm) / sqrt(n())
)
@mutate(
lower = mean_bill - 1.96 * se_bill,
upper = mean_bill + 1.96 * se_bill
)
endFails with error "No method matching nrow()". You can get this to run by separating the steps, like so:
df_h = @chain penguins begin
@group_by(species)
@summarize(
mean_bill = mean(bill_length_mm),
sd_bill = std(bill_length_mm),
n = n()
)
@mutate(
se_bill = sd_bill / sqrt(n)
)
@mutate(
lower = mean_bill - 1.96 * se_bill,
upper = mean_bill + 1.96 * se_bill
)
endBut I don't think you would need to separate it out like this in dplyr
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels