Hello,

Maybe filter the AllowByLimitFlag values first (not tested)?


tmp1 <- tmp %>%
  group_by(HCPCSCode) %>%
  filter(AllowByLimitFlag) %>%
summarise(Avg_AllowByLimit = mean(Avg_AllowByLimit[which(Avg_AllowByLimit!=0)]))


Hope this helps,

Rui Barradas


Às 13:35 de 22/05/19, Bill Poling escreveu:
tmp1 <- tmp %>%
group_by(HCPCSCode) %>%
summarise(Avg_AllowByLimit = mean(Avg_AllowByLimit[which(Avg_AllowByLimit!=0)]))

# But I need Something like that + This

WHERE AllowByLimitFlag == TRUE

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to