Re: [R] linetype corruption in ggplot2

2021-10-01 Thread Troels Ring
Thanks a lot, Rui - this works well - although I still fail to see why a loop could not do it although your explanation for the problem is well taken! All best Troels Den 01-10-2021 kl. 15:21 skrev Rui Barradas: Hello, The problem is in the for loop. Every time through it the data argument

Re: [R] linetype corruption in ggplot2

2021-10-01 Thread Rui Barradas
Hello, The problem is in the for loop. Every time through it the data argument changes and ggplot only evaluates when printing, not when it's constructing the object. It's not a good idea to construct a ggplot object in a loop. Why don't you put x and BB in a data.frame, reshape it to long f

[R] linetype corruption in ggplot2

2021-10-01 Thread Troels Ring
Dear friends - another simple question: the assignment of linetype seems to be corrupted in the code below- I would want the solid line to be the lowest  and also want the legend to be correct. I guess R orders the legend names alphabetically and could handle  that but cannot unnderstand how the

[R] How to get a given cut-off in logit regression?

2021-10-01 Thread Luigi Marongiu
Hello, I would like to calculate the 95% success rate of a test. I have a series of dilutions and the proportion of positive results out of 37 attempts for each of them. I would like to find the concentration that gives 95% success and I used logit regression: ``` df <- data.frame(concentration = c