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

标签:
s.classrade4 |
分类: 技术 |
文档原文
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
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