R’s semantic riddles [🇷 for BE/BA]
Hi ElMaestro,
Sure. I’m a regular guest at my pet doctor. Where do you think I’m getting my pills from?
Yeah, some of R’s functions are very efficient but difficult to comprehend. Martin once provided me with a framework full of
In my code I use obscure one-liners only in sim’s where speed prevails over clarity.
My code gives:
I’m happy with that. Or would you prefer to flag the 0.01 as crap and come up with a lagtime of 2? BTW, your code comes up with 1.5.
Not only with OIPs. We have discussed this issue occasionally (here and there).
Interesting hobby.
They should not practice BDSM with their machines, but receive bastinado themselves. As a cap’tain you are familiar with the cat o’ nine tails.
Edit: If
❝ age taking its toll on your eyes? Go visit the veterinarian.
Sure. I’m a regular guest at my pet doctor. Where do you think I’m getting my pills from?
❝ -I had to read the online documentation to understand what which.max
actually does.
Yeah, some of R’s functions are very efficient but difficult to comprehend. Martin once provided me with a framework full of
lapply()
, sweep()
, aggregate()
, simplify2array()
, with()
, etc. as a wrapper to functions used in sim’s. Speeded up the code at least 10fold. But: I read Cuneiform script more fluent than this gibberish.In my code I use obscure one-liners only in sim’s where speed prevails over clarity.
❝ I wonder, how would Tmax be defined in cases of e.g.
❝ time <- c( 0, 1, 1.5, 2, 4, 5, 6, 7, 8, 9)
❝ conc <- c(NA, NA, 0.01, NA, 19, 56, 53, 46, 40, NA)
My code gives:
Tmax = 5
Tlag = 1
I’m happy with that. Or would you prefer to flag the 0.01 as crap and come up with a lagtime of 2? BTW, your code comes up with 1.5.
❝ - something like that is not entirely uncommon with OIPs, …
Not only with OIPs. We have discussed this issue occasionally (here and there).
❝ … some CROs are really spanking the 5500
Interesting hobby.
❝ … and manipulating the low QC integrations
They should not practice BDSM with their machines, but receive bastinado themselves. As a cap’tain you are familiar with the cat o’ nine tails.

Edit: If
time[1]
is not given and no NAs occur before tmax, my code returns numeric(0), which cannot be used in further calculations.- No lag-time, zero as NA:
time <- c( 0, 1, 1.5, 2, 4, 5, 6, 7, 8, 9)
conc <- c(NA, 1, 3, 5, 19, 56, 53, 46, 40, NA)
data <- data.frame(time, conc)
Tmax <- data$time[which(data$conc == max(data$conc[complete.cases(data)]))]
Tlag <- data$time[which.max(complete.cases(data))-1] cat("Tmax =", Tmax, "\nTlag =", Tlag, "\n")
Tmax = 5
Tlag = 0
- No lag-time, zero time point not given:
time <- c(1, 1.5, 2, 4, 5, 6, 7, 8, 9)
conc <- c(1, 3, 5, 19, 56, 53, 46, 40, NA)
data <- data.frame(time, conc)
Tmax <- data$time[which(data$conc == max(data$conc[complete.cases(data)]))]
Tlag <- data$time[which.max(complete.cases(data))-1] cat("Tmax =", Tmax, "\nTlag =", Tlag, "\n")
Tmax = 5
Tlag =
Oops!
- As above + workaround:
if(length(Tlag) == 0) Tlag <- 0
cat("Tmax =", Tmax, "\nTlag =", Tlag, "\n")
Tmax = 5
Tlag = 0
—
Dif-tor heh smusma 🖖🏼 Довге життя Україна!![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- ‘Automatic’ selection of time points for λz Helmut 2013-07-22 19:14
- New code Helmut 2013-07-23 02:06
- TTT flawed in case of a lagtime… Helmut 2013-07-23 19:59
- TTT flawed in case of a lagtime… martin 2013-07-23 20:22
- TTT flawed in case of a lagtime… ElMaestro 2013-07-23 22:35
- minimalistic R Helmut 2013-07-24 01:04
- Wow, very efficicient ElMaestro 2013-07-24 10:49
- R’s semantic riddlesHelmut 2013-07-24 14:10
- Wow, very efficicient ElMaestro 2013-07-24 10:49
- minimalistic R Helmut 2013-07-24 01:04
- TTT flawed in case of a lagtime… Helmut 2013-07-23 19:59
- New code Helmut 2013-07-23 02:06