[問題] R-studio scatterplot 的labels問題

作者: AmigoSafin   2018-07-30 04:17:03
文章分類提示:
- 問題: 當你想要問問題時,請使用這個類別。
建議先到 http://tinyurl.com/mnerchs 搜尋本板舊文。
[問題類型]:
請把以下不需要的部份刪除
程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來)
[軟體熟悉度]:
請把以下不需要的部份刪除
入門(寫過其他程式,只是對語法不熟悉)
[問題敘述]:
請簡略描述你所要做的事情,或是這個程式的目的
大家好
我使用一個簡單的scatterplot指令
但在labels=rownames(mtcars)這邊
出現了error
在網路上找了一些相關問題
試著用axis(side = 1, at = Labels, labels = FALSE)
去看看是否可以順利產出跟範例一樣的圖
還是不行
因此來請教大家
初學者還請大家見諒
[程式範例]:
請把以下不需要的部份刪除
scatterplot(mpg ~ wt | cyl, data = mtcars, xlab = "Weight of Car", ylab =
"Miles Per Gallon", main= "Enhanced Scatter Plot", labels = row.names(mtcars))
Error in axis(side = side, at = at, labels = labels, ...) :
'labels' is supplied and not 'at'
[環境敘述]:
請提供 sessionInfo() 的輸出結果,
裡面含有所有你使用的作業系統、R 的版本和套件版本資訊,
讓版友更容易找出錯誤
R 3.5.1
R studio
[關鍵字]:
選擇性,也許未來有用
作者: andrew43 (討厭有好心推文後刪文者)   2018-07-30 08:28:00
car::scatterplot 應該沒有 labels 這個參數另為 cyl 應該用 as.factor() 包起來較妥當。
作者: AmigoSafin   2018-08-01 06:41:00
謝謝大大熱心協助!!

Links booklink

Contact Us: admin [ a t ] ucptt.com