[問題] ggplot兩軸指定問題

看板R_Language作者 (wengbei)時間7年前 (2017/02/04 19:01), 編輯推噓0(009)
留言9則, 2人參與, 最新討論串1/1
[問題類型]: 程式諮詢(我想用R 做某件事情,但是我不知道要怎麼用R 寫出來) [軟體熟悉度]: 新手(沒寫過程式,R 是我的第一次) [問題敘述]: 我想要用ggplot2裡面的繪圖功能將特定點標記出來。 例如: 1. q-q plot for chi square 2. 許多變數合併比較的boxplot 我想知道outliers是哪些屬性 查了許多資料後發現ggplot的aes必須指定兩軸對應參數 但是上述兩個圖形都是multivariate構成 我不知道要怎麼設定兩軸參數 [程式範例]: http://ideone.com/x7Cm9m# [環境敘述]: R version 3.3.2 (2016-10-31) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) locale: [1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C LC_TIME=English_United Kingdom.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] MVN_4.0.2 loaded via a namespace (and not attached): [1] mlbench_2.1-1 zoo_1.7-14 modeltools_0.2-21 nortest_1.0-4 kernlab_0.9-25 [6] splines_3.3.2 VIM_4.6.0 lattice_0.20-34 pcaPP_1.9-61 colorspace_1.3-2 [11] stats4_3.3.2 mgcv_1.8-15 e1071_1.6-7 nloptr_1.0.4 foreign_0.8-67 [16] prabclus_2.2-6 sp_1.2-4 RColorBrewer_1.1-2 fpc_2.1-10 sgeostat_1.0-27 [21] plyr_1.8.4 robustbase_0.92-7 MatrixModels_0.4-1 stream_1.2-3 munsell_0.4.3 [26] robCompositions_2.0.3 pls_2.6-0 gtable_0.2.0 moments_0.14 mvtnorm_1.0-5 [31] psych_1.6.12 codetools_0.2-15 laeken_0.4.6 GGally_1.3.0 SparseM_1.74 [36] lmtest_0.9-34 quantreg_5.29 pbkrtest_0.4-6 flexmix_2.3-13 parallel_3.3.2 [41] class_7.3-14 sROC_0.1-2 vcd_1.4-3 DEoptimR_1.0-8 trimcluster_0.1-2 [46] Rcpp_0.12.9 scales_0.4.1 diptest_0.75-7 clusterGeneration_1.3.4 dbscan_0.9-8 [51] lme4_1.1-12 mnormt_1.5-5 ggplot2_2.2.1 grid_3.3.2 clue_0.3-53 [56] tools_3.3.2 lazyeval_0.2.0 proxy_0.4-16 tibble_1.2 cluster_2.0.5 [61] cvTools_0.3.2 car_2.1-4 rrcov_1.4-3 MASS_7.3-45 Matrix_1.2-7.1 [66] data.table_1.10.0 mvoutlier_2.0.8 assertthat_0.1 minqa_1.2.4 reshape_0.8.6 [71] boot_1.3-18 mclust_5.2.2 nnet_7.3-12 nlme_3.1-128 [關鍵字]: ggplot2 q-q plot for chi square distribution boxplot multivariate ------ 第一次在貴版po文,還請各位R高手多多指教! 非常感謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 128.176.164.20 ※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1486206067.A.ACC.html

02/04 20:02, , 1F
要繪的點再額外用geom_point標出來就好啦
02/04 20:02, 1F

02/04 20:02, , 2F
給個能夠實作的範例吧,你資料也沒有附上
02/04 20:02, 2F

02/04 21:49, , 3F
我有放連結在程式範例。geom_point是我的目的,但是過程
02/04 21:49, 3F

02/04 21:51, , 4F
中ggplot的aes我不知道怎麼指定兩軸參數,這是我的問題。
02/04 21:51, 4F

02/04 21:52, , 5F
我需要可以直接執行的範例,如果沒有,等別人回吧
02/04 21:52, 5F

02/04 21:53, , 6F
dataset可在這裡下載https://openml.tue.nl/d/9
02/04 21:53, 6F

02/04 21:56, , 7F
下載還要會員,好麻煩
02/04 21:56, 7F

02/04 21:56, , 8F
等其他善心人士吧~~~
02/04 21:56, 8F

02/04 21:57, , 9F
我很懶,抱歉
02/04 21:57, 9F
文章代碼(AID): #1ObRHphC (R_Language)