R lattice作图基本知识

lattice 多维数据控制变量分组分析

xyplot(y~x|f*g,data) ##散点图  f g 都需为因子变量as.factor
xyplot(,data,layout=c(2,2))
data
xlab/ylab/mian
strip ##是否标记每个panel(默认是)


bwplot() ##箱型图
stripplot() ##以点画图
histigram() ##直方图
dotplot() ##线上画点 
splom() ##散点图矩阵pairs()
levelplot() ##图形数据
contourplot() ##图形视图


xyplot(y~x|f,panel=function(x,y,...){
    panel.xyplot(x,y,...)
    panel.abline(h,lty) ##添加基准线
    panel.lmline(,y,col=2) ##添加回归线
})


在用lattice建立分组分析时,建议用table观察数据的分布。明确分组维度。


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
About this book Gives a comprehensive overview of the Lattice graphics system and shows how to use it effectively Includes numerous examples using data sets from various R packages All code and figures including color version also available online R is rapidly growing in popularity as the environment of choice for data analysis and graphics both in academia and industry. Lattice brings the proven design of Trellis graphics (originally developed for S by William S. Cleveland and colleagues at Bell Labs) to R, considerably expanding its capabilities in the process. Lattice is a powerful and elegant high level data visualization system that is sufficient for most everyday graphics needs, yet flexible enough to be easily extended to handle demands of cutting edge research. Written by the author of the lattice system, this book describes it in considerable depth, beginning with the essentials and systematically delving into specific low levels details as necessary. No prior experience with lattice is required to read the book, although basic familiarity with R is assumed. The book contains close to150 figures produced with lattice. Many of the examples emphasize principles of good graphical design; almost all use real data sets that are publicly available in various R packages. All code and figures in the book are also available online, along with supplementary material covering more advanced topics. Deepayan Sarkar won the 2004 John M. Chambers Statistical Software Award for writing lattice while he was a graduate student in Statistics at the University of Wisconsin-Madison. He is currently doing postdoctoral research in the Computational Biology program at the Fred Hutchinson Cancer Research Center, a member of the R Core Team, and an active participant on the R mailing lists. Written for: Researchers, grad students

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值