# # Data da criação: 15/01/2005 # Última atualização: 01/10/2005 # Autor: Fernando H F P Rosa # Desc: Programinha simples para me auxiliar # a fazer séries de alongamentos no R # URL: www.feferraz.net/br/P/Alongamentos_no_R # faz.fisio <- function(quit.on.close=switch(.Platform$OS.type,windows='no','yes'),save.env = switch(.Platform$OS.type,windows='yes','no')) { if (.Platform$OS.type == 'windows') { windows(width=11,height=7,canvas='wheat') } else { x11(width=7,height=4,canvas='wheat',xpos=-1,ypos=500) } par(ps=100) i <- 0 cont <- 1 layout(matrix(c(2,3,1,4,5,1),2,3,byrow=TRUE), c(1,1), c(1,1)) while(1) { if ((round(proc.time()[3]) %% 20) == 0) { if (is.null(dev.list())) { if (quit.on.close == 'yes') quit(save.env) else break; } plot(0,type='n',axes=F,xlab='',ylab='',xlim=c(-1,1),ylim=c(-1,1)) if (i %% 5 == 0) { text(0,0,cont,vfont=c('sans serif','bold'),cex=2) if (cont == 5) { cont <- 1 } else { cont <- cont + 1 } Sys.sleep(0.4) } else { points(0,0,pch=16,cex=30,col=4) Sys.sleep(19.4) } i <- i + 1 } } }