Joachim,
When you construct a formula like channel1 ~ channel2, 'channel1' and 'channel2' are simply treated as symbols and will be passed to xyplot as they are without evaluating. One solution is to construct a string and convert it to a formula.
f_str <- paste0(channel1, "~", channel2)
f <- as.formula(f_str)
xyplot(f, frame)
See another related post regarding to the formula A: xyplot can't find channel (flowViz)
Mike
Hi Mike,
I want to use the xyplot method of the flowViz package. I'm writing a method in which the user determines the channels he want to use for the xyplot like the followgin:
plot<-function(channel1="FS.Log",channel2="FL.4.Log"){
frame<-read.FCS(...)
xyplot(channel1 ~ channel2, frame)
}
But this does not work because channel1 within the xyplot method does not match channel1 in the function definition. I also tried to do it without quotes (channel1=FS.Log) but this does not work, too. Do you know what I can do to get a match in this way?
Best,
Joachim
--
M. Sc. Joachim Schumann