R) Create double-labeled MDS plot

后端 未结 2 1787
轮回少年
轮回少年 2021-01-07 15:25

I am totally new to R.
I have expression profile data which is preprocessed and combined. Looks like this (\"exp.txt\")

       STUDY_1_CANCER_1   STUDY_         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-07 16:08

    Actually, you can do this directly in default plot command which can take pch and col arguments as vectors. Use:

    with(data, plot(mds, col = as.numeric(Study), pch = as.numeric(Disease), asp = 1)
    

    You must use asp = 1 when you plot cmdscale results: both axes must be scaled similarly. You can also add xlab and ylab arguments for nicer axis labels. For adding legend and selecting plotting characters and colours, see other responses.

提交回复
热议问题