Hola queridos usuarios de R Estoy intentando hacer un gráfico de una variable en el tiempo para un conjunto de países usando R base, con el comando plot. Tengo 40 países y son 15 años. Lo quiero salvar como formato png, cada uno de ellos.
Tengo el siguiente código, for (i in 1:length(countrylist)){ currcty <- countrylist[i] filename <- paste("index",currcty,".png",sep="") png(filename,width=800,height=600) plot(y=eco_freedom2$SUMMARY.INDEX[eco_freedom2$Countries==currcty], x=eco_freedom2$Year[eco_freedom2$Countries==currcty], type="l", ylab="INDEX",xlab="YEAR", main = paste("Countries", currcty)) dev.off() } Pero me aparece el error Error in plot.window(...) : se necesitan valores finitos de 'xlim'. La variable y = SUMMARY.INDEX tiene valores Nas, y es tipo numerico, y la variable x= Year es integer. Entiendo que es por el problema de los NAs, por lo que da error. Si embargo al usar na.omit(dataset), y quedarnos con los valores que no son NA, me sigue saliendo el mismo error Alguna idea, gracias -- Member, Editorial Committee, *The Economic and Labour Relations Review* (a SAGE journal) http://elr.sagepub.com/ Member, Editorial Committee, African Journal of Economic and Management Studies http://emeraldgrouppublishing.com/products/journals/editorial_team.htm?id=ajems https://www.researchgate.net/profile/Antonio_Andres (Research Gate profile) [[alternative HTML version deleted]] _______________________________________________ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es