R语言画图基础参数设置】的更多相关文章

Graphical Parameters You can customize many features of your graphs (fonts, colors, axes, titles) through graphic options. One way is to specify these options in through the par( ) function. If you set parameter values here, the changes will be in ef…
R 语言画图的基本参数 点 点的种类 点的种类参数为 pch,每一种符号对应一个数字编号 # 点有25种,为了展示25种点 x = 1:25 y = 1:25 x ## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ## [24] 24 25 plot(x, x, pch = x) # 在图上随意添加点 lines(10, 15, type = "b", pch = 5) # type的含义 plot(x…
最近用R语言画图,plot 函数是用的最多的函数,而他的参数非常繁多,由此总结一下,以供后续方便查阅. plot(x, y = NULL, type = "p", xlim = NULL, ylim = NULL, log = "", main = NULL, sub = NULL, xlab = NULL, ylab = NULL, ann = par("ann"), axes = TRUE, frame.plot = axes, panel.…
R语言语法基础二 重塑数据 增加行和列 # 创建向量 city = c("Tampa","Seattle","Hartford","Denver") state = c("FL","WA","CT","CO") zipcode = c(33602, 98104, 06161, 80294) # 组合向量成数据帧 address1 = cbind(c…
R语言画图教程之盒形图 我们之前有分享过一系列的R语言画图代码(PCA图.Pathway图.火山图.RDA图.热图),今天再来补充一个盒形图(箱形图)的代码. 以下代码只是示例,不能直接搬来用哦,注意看注释. --------------代码开始了------------- setwd("E:/") #改变工作目录 data=read.table("data.txt",header=T) #读取数据,"header=T"第一行为表头 mycolo…
R语言语法基础一 Hello world #这里是注释 myString = "hello world" print(myString) [1] "hello world" 基本数据类型 print(class(TRUE)) #logical print(class(5)) #Numeric print(class(2L)) #Integer print(class(2+5i)) #Complex print(class("hello")) #C…
shell中调用R语言并传入参数的两种方法 第一种: Rscript myscript.R R脚本的输出 第二种: R CMD BATCH myscript.R # Check the output cat myscript.Rout 调用R脚本的全部控制台log 传入参数: 在脚本中add args<-commandArgs(TRUE) 然后shell中: Rscript myscript.R arg1 arg2 arg3 注意取出来的参数是所有参数连在一起的character…
原文链接:http://www.biostatistic.net/thread-5065-1-1.html R语言在画图形的时候,经常遇到颜色设定问题,用户可以根据color.rgb值和hsv值来设定不同的颜色.第一列是颜色,第二列是hsv,第三列是rgb<ignore_js_op> 在颜色设定时,最好是根据自己想要的颜色来设定.这样我们能做到心中有数.所有可以用下面方法来设定颜色,简单有效. library(grDevices);ramp <- colorRamp(c("re…
本文对应<R语言编程艺术> 第7章:R语言编程结构: 第9章:面向对象的编程: 第13章:调试 ========================================================================= R语言编程结构 控制语句: 循环: for (n in x) { } while (condition) { } repeat { } 另外break也可以用在另两种形式的循环语句中.注意repeat没有跳出循环的判断条件,因此使用break(或者类似r…
本文以1950年到2010年期间我国的火灾统计数据为例,数据如下所示: (0)加载数据 data<-read.csv("E:\\MyDocument\\p\\Data\\1950~2010火灾情况.csv") x=t(data[1]) y=t(data[2]) z=t(data[3]) w=t(data[4]) maxy=max(y) maxz=max(z) maxw=max(w) (1)将火灾数.直接损失.死伤人数,分别按年份作图 plot(x,y,type="o&q…