drc
drc copied to clipboard
Normalization scrambles points and curves
Hi there, I'm a big fan of the package. I came across the following issue when using the normal = T
option in plot.drc
. I've included the following reproducible example.
Plotting the unnormalized data works just fine:
library(drc)
mydata <- read.csv("repex.csv")
drc.model <- drm(abs ~ conc, drug, data = mydata, fct = LL.4())
plot(drc.model,
type = "average",
normal = F,
col = T,
broken = T,
)
...but when I set the normal
option to TRUE
, the points for labels and curves for Ap Am appear to be mismatched. The curves are correct, but the points are misplotted
plot(drc.model,
type = "average",
normal = T,
col = T,
broken = T,
)
Setting type = "bars"
also seems to normalize the curves, but not the error bars:
plot(drc.model,
type = "bars",
normal = T,
col = T,
broken = T,
)
The first issue can be corrected by sorting the data alphabetically first., but in a fix it would be desirable to control the order of the points in the legend.
Happy to contribute to a potential fix. 🤓