1
I need to make a graph in the concatenated R, are 4177 iterations, I’m using ggplot2, but is giving the error below:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Error during wrapup: evaluation nested too deeply: infinite recursion / options(expressions=)?
#geradora de dados sintéticos (triangulos)
#argumentos: numero de poligonos desejados, numero de vertices
gera_poligonos = function(numero_objetos, numero_vertices){
dados = NULL
for(i in 1:numero_objetos) dados[[i]] = matrix(rnorm(numero_vertices*2), ncol = 2)
return(dados)
}
#Funcao que plota os poligonos desejados (neste caso triangulos)
plot_poligono <- function(poligono){
numero_vertices = nrow(poligono[[1]])
g = ggplot()
if(numero_vertices == 3){
for(i in 1:length(poligono)){
g = g + geom_polygon(data = data.frame(poligono[i]), aes(x = X1, y = X2), colour="black", fill = NA)
}
return(g)
}
else print("Insira um poligono de tres vertices")
}
#
teste = gera_poligonos(4177, 3)
plot_poligonos(teste)
Correct your spelling mistakes, arrange and organize your text, post the code (even if it is entire) through the "code" tab and put in hide code, will help your question to be answered and avoid down votes.
– João Victor Gomes Moreira
Wagner, this error is very general, it is impossible to give any suggestion without seeing the code. At the very least you should post the line that gives the error, but still it will be difficult to understand the problem. Investigate your code and try to reduce it to a minimum reproducible example, with less data, less manipulation, etc., but that generates the error. Otherwise I don’t think we can help you.
– Molx
I edited, I put the simplest code I could, I thought it was a specific mistake. Thank you guys.
– Wagner Jorge