加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

R语言s.class的简单讲解[整理版]

(2013-11-21 13:49:57)
标签:

s.class

r

ade4

分类: 技术
文档原文
http://pbil.univ-lyon1.fr/ade4/ade4-html/s.class.html

1. 例子
library(ade4)
#Name: s.class
### Title: Plot of factorial maps with representation of point classes
### Aliases: s.class
### Keywords: multivariate hplot
 
### ** Examples

xy <- cbind.data.frame(x = runif(200,-1,1), y = runif(200,-1,1))
posi <- factor(xy$x > 0) : factor(xy$y > 0)
coul <- c("black", "red", "green", "blue")
par(mfrow = c(2,2))
s.class(xy, posi, cpoi = 2)
text(0.5,1.0, "label")

结果:
http://s4/mw690/0023Xr6agy6EopCXPVh13&690


例子2:
library(ade4)
#Name: s.class
### Title: Plot of factorial maps with representation of point classes
### Aliases: s.class
### Keywords: multivariate hplot
 
### ** Examples

xy <- cbind.data.frame(x = runif(200,-1,1), y = runif(200,-1,1))
posi <- factor(xy$x > 0) : factor(xy$y > 0)
coul <- c("black", "red", "green", "blue")
par(mfrow = c(2,2))
s.class(xy, posi, cpoi = 2, label=c("main1","main2","main3", "main4"))

结果:
http://s14/mw690/0023Xr6agy6EopEZDPv8d&690

简单说明:
例子1 和例子2都是使用s.class的基本的作图组件,唯一的区别是我们使用了两种不同的方式添加label, 第一种方式,我们使用text()函数,指定对应的作标,添加标签,第二种方式,我们使用s.class自带的label参数,也就是在图中间出现参数。

只不过有这样一个问题,用text()的方法,在四个图中,y轴坐标只能写到[-0.5,0.5],x轴只能写到[-0.75,0.5]

version 2013-11-21



0

阅读 收藏 喜欢 打印举报/Report
前一篇:感恩
后一篇:blast的报错
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有