R语言数据可视化.ppt

上传人:sh****n 文档编号:15716254 上传时间:2020-09-01 格式:PPT 页数:50 大小:3.44MB
返回 下载 相关 举报
R语言数据可视化.ppt_第1页
第1页 / 共50页
R语言数据可视化.ppt_第2页
第2页 / 共50页
R语言数据可视化.ppt_第3页
第3页 / 共50页
点击查看更多>>
资源描述
1,语言,数据可视化,2,学习内容,一 R绘图基础 二 各类图形绘制 三 习题和资料,为什么要学习R语言,R是 一个开放(GPL)的统计编程环境 一种语言,是语言(由AT qqline(y, col = 2) #和正态分布比 qqplot(y, rt(300, df = 5); #和t(5)分布比 data(precip) qqnorm(precip, ylab = “Precipitation in/yr for 70 US cities”); qqline(precip,col=3) #和正态分布比 par(mfrow=c(1,1),QQ图,24,data(iris) pairs(iris1:4, main = Andersons Iris Data - 3 species, pch = 21, bg = c(red, green3, blue)codes(iris$Species) #iris为1505数据,这里是4个数量变量的点图(最后一个是分类变量(iris$Species),散点图矩阵,par(bg = cornsilk) data(quakes) coplot(lat long | depth, data = quakes, pch = 21, bg = green3)#Hit to see next plot:,25,条件分割图,x - seq(-10, 10, length= 30) y - x f - function(x,y) r - sqrt(x2+y2); 10 * sin(r)/r z - outer(x, y, f) zis.na(z) - 1 persp(x, y, z, theta = 30, phi = 30, expand = 0.5, col = lightblue),26,三维透视图,27,data(volcano) rx - range(x - 10*1:nrow(volcano) ry - range(y - 10*1:ncol(volcano) ry - ry + c(-1,1) * (diff(rx) - diff(ry)/2 tcol - terrain.colors(12) par(opar); opar - par(pty = s, bg = lightcyan) plot(x = 0, y = 0,type = n, xlim = rx, ylim = ry, xlab = , ylab = ) u - par(usr) rect(u1, u3, u2, u4, col = tcol8, border = “red”) #rect画矩形 contour(x, y, volcano, col = tcol2, lty = solid, add = TRUE, vfont = c(sans serif, plain) title(A Topographic Map of Maunga Whau, font = 4) abline(h = 200*0:4, v = 200*0:4, col = lightgray, lty = 2, lwd = 0.1);par(opar),等高线图,28,等高线图,29,data(volcano) x - 10*(1:nrow(volcano) y - 10*(1:ncol(volcano) image(x, y, volcano, col = terrain.colors(100), axes = FALSE) contour(x, y, volcano, levels = seq(90, 200, by=5), add = TRUE, col = peru) axis(1, at = seq(100, 800, by = 100) axis(2, at = seq(100, 600, by = 100) box() title(main = Maunga Whau Volcano, font.main = 4),颜色图,30,颜色图,ggplot2,31,32,ggplot2简介,33,为什么要使用ggplot2,34,Ggplot2的基本概念,35,数据(data)和映射(mapping),36,几何对象(Geometric),37,统计变换(statistics),38,坐标(coordinate),39,图层(layer),40,分面(facet),41,42,43,三 习题和资料,44,练习1:绘图,生成0到2之间的50个随机数,分别命名为x,y x - runif(50,0,2) y - runif(50,0,2) 绘图:将主标题命名为“散点图”, 横轴命名为”横坐标”, 纵轴命名为“纵坐标” plot(x, y, main=散点图, xlab=横坐标, ylab=纵坐标) text(0.6,0.6,text at (0.6,0.6) abline(h=.6,v=.6),45,图 练习1:绘图举例,46,练习2:分步绘图,1.打开绘图窗口,不绘制任何对象 plot(x, y, type=n, xlab=, ylab=, axes=F) #用练习1的x、y值 2.添加坐标点 points(x,y) 3.添加坐标轴 axis(1); axis(at=seq(0.2,1.8,0.2), side=2) 4.补齐散点图的边框 box() 5.添加标题、副标题、横轴说明、纵轴说明 title(main=Main title, sub=subtitle, xlab=x-label, ylab=y-label),47,图 练习2:分步绘图,48,教材,Crawley Statistics an introduction using R Peter Dalgaard Introductory statistics with R E. Paradis R for Beginners Verzani SimpleR. D G Rossiter Introduction to the R Project for Statistical Computing for use at ITC J. Maindonald Using R for data analysis and graphics introduction code and commentary using R Venables, W. N. & Ripley, B. D. Modern Applied Statistics with S,49,R网络资源,R主页: http:/www.r-project.org R资源列表 NCEAS http:/www.nceas.ucsb.edu/scicomp/software/r 统计之都: http:/cos.name/ QuikR R数据挖掘 http:/www.RdataM 在线数据分析协作平台 R- 大数据分析的众包平台-Kaggle ,50,谢谢!,
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 图纸专区 > 课件教案


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!