R语言之数据可视化学习记录2:Lattice绘图系统

本文是2018年7月31日的学习笔记,主要探讨R语言中的Lattice绘图系统,介绍了如何安装和加载lattice包。Lattice系统包含xyplot等多功能,用于创建复杂的分面图形。通过实例展示了如何使用xyplot绘制温度与氧气含量的散点图,并添加了回归线和均值线,强调了在生成随机数据时设置种子的重要性。
摘要由CSDN通过智能技术生成

时间: 2018-07-31
教程: 慕课网 《R语言之数据可视化》 讲师:Angelayuan
学习内容: 课程第三章5-6节


数据可视化

2. Lattice绘图系统

Lattice绘图系统包含在lattic包中。
该系统包含许多函数:xyplot / bwplot / histogram / stripplot / dotplot / splom / leveplot / contourplot等
xyplot函数格式:xyplot(y ~ x | f*g, data),其中 f*g为因子类型,该参数可省略。
Base绘图系统直接在图形设备上绘图,而Lattice绘图系统返回trellis类对象,然后由打印函数在设备上进行绘图,但在执行Lattice命令时,打印自动进行。
install.packages(“lattice”):下载lattice包
library(lattice):加载lattice包
使用lattice包之前应先加载。
如:
使用xyplot函数绘制温度~氧气含量的散点图:

library(lattice)
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、付费专栏及课程。

余额充值