没有合适的资源?快使用搜索试试~ 我知道了~
using r for data analysis and graphics
4星 · 超过85%的资源 需积分: 9 76 下载量 55 浏览量
2008-05-31
09:45:25
上传
评论
收藏 2.14MB PDF 举报
温馨提示
试读
99页
R 语言学习系列之一。<br>Using R for Data Analysis and Graphics<br>Introduction, Code and Commentary<br>J H Maindonald<br>Centre for Bioinformation Science,<br>Australian National University.
资源推荐
资源详情
资源评论
Using R for Data Analysis and Graphics
Introduction, Code and Commentary
J H Maindonald
Centre for Bioinformation Science,
Australian National University.
©J. H. Maindonald 2000, 2004. A licence is granted for personal study and classroom use. Redistribution in
any other form is prohibited.
Languages shape the way we think, and determine what we can think about (Benjamin Whorf.).
14 November 2004
ii
ii
t a i l
le n gt h
6 0 6 5 7 0 7 5
3 2
34 36 38 40 42
60 65 70 75
f o o t
le n gt h
3 2 3 6 4 0
e a r c o n c h
le n gt h
4 0
45 50 55
4 0
4 5 5 0 5 5
C a m bar v ille
B e llbir d
W h ia n W h ian
B y ra n ge r y
C o n o n dale
A lly n R iv e r
B ulburin
fe m ale m ale
Lindenmayer, D. B., Viggers, K. L., Cunningham, R. B., and Donnelly, C. F. : Morphological variation
among populations of the mountain brushtail possum, trichos urus caninus Ogibly
(Phalangeridae:Marsupialia). Australian Journal of Zoology 43: 449-459, 1995.
possum n. 1 Any of many chiefly herbivorous, long-tailed, tree-dwelling, mainly Australian marsupials, some
of which are gliding animals (e.g. brush-tailed possum, flying possum). 2 a mildly scornful term for a person. 3
an affectionate mode of address.
From the Australian Oxford Paperback Dictionary, 2
nd
ed, 1996.
Introduction ..................................................................................................................................................................1
1. Starting Up ................................................................................................................................................................3
1.1 Getting started under Windows ......................................................................................................................3
1.2 Use of an Editor Script Window .....................................................................................................................4
1.3 A Short R Session............................................................................................................................................5
1.4 Further Notational Details.............................................................................................................................7
1.5 On-line Help....................................................................................................................................................7
1.6 The Loading or Attaching of Datasets...........................................................................................................7
1.7 Exercises..........................................................................................................................................................8
2. An Overview of R .....................................................................................................................................................9
2.1 The Uses of R .......................................................................................................................................................9
2.2 R Objects ............................................................................................................................................................11
*2.3 Looping.............................................................................................................................................................12
2.4 Vectors ................................................................................................................................................................12
2.5 Data Frames ......................................................................................................................................................15
2.6 Common Useful Functions ................................................................................................................................16
2.7 Making Tables....................................................................................................................................................17
2.8 The Search List ..................................................................................................................................................17
2.9 Functions in R ....................................................................................................................................................18
2.10 More Detailed Information .............................................................................................................................19
2.11 Exercises...........................................................................................................................................................19
3. Plotting.....................................................................................................................................................................21
3.1 plot () and allied functions ................................................................................................................................21
3.2 Fine control – Parameter settings ....................................................................................................................21
3.3 Adding points, lines and text .............................................................................................................................22
3.4 Identification and Location on the Figure Region ..........................................................................................24
3.5 Plots that show the distribution of data values................................................................................................25
3.6 Other Useful Plotting Functions.......................................................................................................................27
3.7 Plotting Mathematical Symbols ........................................................................................................................29
3.8 Guidelines for Graphs .......................................................................................................................................29
3.9 Exercises.............................................................................................................................................................30
3.10 References ........................................................................................................................................................31
4. Lattice graphics ......................................................................................................................................................33
4.1 Examples that Present Panels of Scatterplots – Using xyplot() ..............................................................33
4.2 An incomplete list of lattice Functions .............................................................................................................34
4.3 Exercises.............................................................................................................................................................35
5. Linear (Multiple Regression) Models and Analysis of Variance....................................................................37
5.1 The Model Formula in Straight Line Regression ............................................................................................37
iv
iv
5.2 Regression Objects ............................................................................................................................................37
5.3 Model Formulae, and the X Matrix ..................................................................................................................38
5.4 Multiple Linear Regression Models .................................................................................................................40
5.5 Polynomial and Spline Regression ...................................................................................................................43
5.6 Using Factors in R Models ...............................................................................................................................46
5.7 Multiple Lines – Different Regression Lines for Different Species ................................................................48
5.8 aov models (Analysis of Variance) ...................................................................................................................49
5.9 Exercises.............................................................................................................................................................51
5.10 References ........................................................................................................................................................52
6. Multivariate and Tree-based Methods ...............................................................................................................55
6.1 Multivariate EDA, and Principal Components Analysis ................................................................................55
6.2 Cluster Analysis .................................................................................................................................................56
6.3 Discriminant Analysis .......................................................................................................................................56
6.4 Decision Tree models (Tree-based models).....................................................................................................57
6.5 Exercises.............................................................................................................................................................58
6.6 References ..........................................................................................................................................................58
*7. R Data Structures ................................................................................................................................................59
7.1 Vectors ................................................................................................................................................................59
7.2 Missing Values ...................................................................................................................................................59
7.3 Data frames........................................................................................................................................................60
7.4 Data Entry ..........................................................................................................................................................61
7.5 Factors and Ordered Factors ...........................................................................................................................62
7.6 Ordered Factors ................................................................................................................................................63
7.7 Lists.....................................................................................................................................................................64
*7.8 Matrices and Arrays ........................................................................................................................................64
7.9 Exercises.............................................................................................................................................................66
8. Functions .................................................................................................................................................................67
8.1 Functions for Confidence Intervals and Tests .................................................................................................67
8.2 Matching and Ordering.....................................................................................................................................67
8.3 String Functions.................................................................................................................................................67
8.4 Application of a Function to the Columns of an Array or Data Frame.........................................................68
*8.5 aggregate() and tapply() .................................................................................................................................68
*8.7 Merging Data Frames .....................................................................................................................................69
8.8 Dates...................................................................................................................................................................69
8.9. Writing Functions and other Code ..................................................................................................................70
8.10 Exercises...........................................................................................................................................................73
*9. GLM, and General Non-linear Models ............................................................................................................75
9.1 A Taxonomy of Extensions to the Linear Model ..............................................................................................75
9.2 Logistic Regression............................................................................................................................................76
v
v
9.3 glm models (Generalized Linear Regression Modelling) ...............................................................................79
9.4 Models that Include Smooth Spline Terms .......................................................................................................79
9.5 Survival Analysis................................................................................................................................................79
9.6 Non-linear Models .............................................................................................................................................80
9.7 Model Summaries ..............................................................................................................................................80
9.8 Further Elaborations.........................................................................................................................................80
9.9 Exercises.............................................................................................................................................................80
9.10 References ........................................................................................................................................................80
*10. Multi-level Models, Repeated Measures and Time Series...........................................................................81
10.1 Multi-Level Models, Including Repeated Measures Models.........................................................................81
10.2 Time Series Models..........................................................................................................................................85
10.3 Exercises...........................................................................................................................................................85
10.4 References ........................................................................................................................................................86
*11. Advanced Programming Topics ......................................................................................................................87
11.1. Methods ...........................................................................................................................................................87
11.2 Extracting Arguments to Functions ................................................................................................................87
11.3 Parsing and Evaluation of Expressions .........................................................................................................88
11.4 Plotting a mathematical expression ...............................................................................................................89
11.4 Searching R functions for a specified token...................................................................................................90
12. Appendix 1 ............................................................................................................................................................91
12.1 R Packages for Windows.................................................................................................................................91
12.2 Contributed Documents and Published Literature........................................................................................91
12.3 Data Sets Referred to in these Notes ..............................................................................................................92
12.4 Answers to Selected Exercises ........................................................................................................................92
剩余98页未读,继续阅读
资源评论
- bill_law62012-06-12好东西,R语言太好使了。
ken88882
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 杨辉三角(Pascal's Triangle)是一个在数学中非常著名的数列,它以一种特定的模式排列数字,内容以5种代码实例实现
- yolov5数据集:CT图像肾脏、结石检测(2类别,包含训练集、验证集)
- 电力102规约请求报文实录
- RTL8723 linux+安卓驱动 2020版本
- ISO 26262 道路车辆-功能安全-系统级产品开发
- 数据挖掘期末题 选择填空简答
- EKF在CTRV模型上的建模推导
- 用于:https://laoshifu.blog.csdn.net/article/details/138191428 多层创建
- 电力102规约(电能累计量的传输规约)培训
- 「常用」E9外部流程接口
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功