name-collision

Why are my dplyr group_by & summarize not working properly? (name-collision with plyr)

霸气de小男生 提交于 2019-11-26 15:11:59
I have a data frame that looks like this: #df ID DRUG FED AUC0t Tmax Cmax 1 1 0 100 5 20 2 1 1 200 6 25 3 0 1 NA 2 30 4 0 0 150 6 65 Ans so on. I want to summarize some statistics on AUC, Tmax and Cmax by drug DRUG and FED STATUS FED . I use dplyr. For example: for the AUC: CI90lo <- function(x) quantile(x, probs=0.05, na.rm=TRUE) CI90hi <- function(x) quantile(x, probs=0.95, na.rm=TRUE) summary <- df %>% group_by(DRUG,FED) %>% summarize(mean=mean(AUC0t, na.rm=TRUE), low = CI90lo(AUC0t), high= CI90hi(AUC0t), min=min(AUC0t, na.rm=TRUE), max=max(AUC0t,na.rm=TRUE), sd= sd(AUC0t, na.rm=TRUE))

What should I do if two libraries provide a function with the same name generating a conflict?

北慕城南 提交于 2019-11-26 03:26:24
问题 What should I do if I have two libraries that provide functions with equivalent names? 回答1: If you control one or both: edit one to change the name and recompile Or equivalently see Ben and unknown's answers which will work without access to the source code. If you don't control either of them you can wrap one of them up. That is compile another ( statically linked !) library that does nothing except re-export all the symbols of the original except the offending one, which is reached through