[R-br] windows.options() - Linux

Luís Gustavo lgsilvaesilva em gmail.com
Quinta Abril 26 12:19:40 BRT 2012


Boa tarde pessoal,

Estou com a seguinte dúvida:
qual o comando que é similar ao windows.options() no Linux, pois este não
existe para o Linux.

O objetivo final é criar uma função que me gera a figura da legenda, porém
esta função tem rodar
tanto no Windows quanto no Linux. Pois gostaria que a figura da legenda se
ajuste para os mais
variados números de faixas.

Abaixo segue um exemplo. (Acredito que função não a mais eficiente,
qualquer sugestão é bem-vinda)

Obrigado.

brks <- c(0,5,10,15,20)
r <- 3
cols <- brewer.pal(4,"Blues")
gera_figura_legenda=function(brks, cols,r)

gera_figura_legenda=function(brks, cols,r) {
brks = round(brks,r)
dest.fig = tempfile(pattern="legenda",fileext=".png",tmpdir=getwd())
 windows.options(width=2.5, height=1.7, pointsize=12, reset = TRUE)
CairoPNG(filename = dest.fig, width = 290, height = 290, bg="#FFFFFF00",
pointsize = 10)
 par(bg="transparent", mar=c(0, 0, 0, 0))
brks = round(brks,r)
 plot(1,1,col="white",axes=F,col.axis="white",xlab="",ylab="")
aux1 = 2:(length(brks)-1)
 aux2 = expand.grid(aux1,aux1)
d    = aux2[,1]-aux2[,2]
aux3 = aux2[d==-1,]
 legend(
"center",
title = "Legenda",
 c(paste("<",brks[2]), paste(brks[aux3[,1]],brks[aux3[,2]],sep="-"),
paste(">",brks[(length(brks)-1)])),
fill=c(cols),
 cex=1.3,
bg="#FFFFFF")
dev.off()
 return (dest.fig)
}

-- 
Luís Gustavo Silva e Silva
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20120426/2ab2c204/attachment.html>


Mais detalhes sobre a lista de discussão R-br