Thank you William appreciate your response Sir.
WHP
From: William Michels
Sent: Wednesday, May 22, 2019 9:58 AM
To: Bill Poling
Cc: r-help (r-help@r-project.org)
Subject: Re: [R] Help with R coding
Morning Bill, I take it this is dplyr? You might try:
tmp1 <- HCPC %>%
group_by(HCP
Thank you Jeff!
WHP
From: Jeff Newmiller
Sent: Wednesday, May 22, 2019 10:06 AM
To: r-help@r-project.org; Rui Barradas ; Bill Poling
; r-help (r-help@r-project.org)
Subject: Re: [R] Help with R coding
Generally more efficient to filter before grouping.
Note that summarize clears out
Generally more efficient to filter before grouping.
Note that summarize clears out whatever isn't mentioned in it, so the
subsetting currently being done in the mean call could also be done in the
pre-filter step and you can avoid filtering other columns and then discarding
them by limiting the
Morning Bill, I take it this is dplyr? You might try:
tmp1 <- HCPC %>%
group_by(HCPCSCode) %>%
summarise(Avg_AllowByLimit =
mean(Avg_AllowByLimit[which(Avg_AllowByLimit!=0 & AllowByLimitFlag ==
TRUE)]))
The code above gives "NaN" for cases where AllowByLimitFlag == FALSE.
Maybe this is the answer
Zelis Healthcare
-Original Message-
From: Rui Barradas
Sent: Wednesday, May 22, 2019 9:46 AM
To: Bill Poling ; r-help (r-help@r-project.org)
Subject: Re: [R] Help with R coding
Hello,
Maybe filter the AllowByLimitFlag values first (not tested)?
tmp1 <- tmp %>%
group_by(HC
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
6 matches
Mail list logo