1
我試圖在圖中繪製一些數字,在x和y行中。問題是我將數字格式化爲3M爲3.000.000,10K爲10.000,然後我試圖使用axis
函數將這些數字放在圖中,問題是我收到消息「Non-數值參數二元運算符」在R中的二元運算符的非數字參數
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")
我今天就工作了,有時候我迷路了,哈哈,我打電話給我畫了一個數據框的列,因爲我的老師向我展示了從csv調用和把變量放在一起的區別。感謝您的幫助,但我仍然有與y軸的消息 –