Skip to content

conditional coloring of output text in console or in GUI

1 message · Jim Lemon

#
Christopher W. Ryan wrote:
tfsample<-as.logical(sample(c(0:1),10,TRUE))
plot(1:10,type="n")
text(1:10,1:10,tfsample,col=ifelse(tfsample,"red","blue"))

Jim