I'm trying to plot some numbers in a graph, in the line x and y. The problem is I'm formatting the numbers as 3M for 3.000.000, 10k for 10.000, then I'm trying to put these numbers in the graph using the axis
function, the problem is that I'm getting the message "Non-numeric argument to binary operator"
x<-c(10000,20000,50000,200000)
y<-c(24679826,99532203,623224134,1422415645)
x1<-paste(format(round(x / 1e3, 1), trim = TRUE), "K")
y1<-c(paste(format(round(y / 1e6, 1), trim = TRUE), "M"))
options(scipen=999)
plot(planilha2$N,planilha2$Iteracoes_Insercao,type="b",
xlab="Tamanho dos Vetores",
ylab="Numero de iterações",
xaxt="n",yaxt="n",pch=16,col="red",lwd=2.2,
main="Inserção iterativo (Vetores gerados aleatoriamente)",
cex.main=1)
axis(1, (paste(format(round(x1 / 1e3, 1), trim = TRUE), "K")))
axis(2,paste(round(y / 1e6, 1), trim = TRUE), "M")