R语言课件总和.ppt

  1. 1、本文档共120页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
R语言课件总和

How to assign vectors controlA=c(0.22, -0.87, -2.39, -1.79, 0.37, -1.54, 1.28, -0.31, -0.74, 1.72, 0.38, -0.17, -0.62, -1.10, 0.30, 0.15, 2.30, 0.19, -0.50, -0.09) treatmentA=c(-5.13, -2.19, -2.43, -3.83, 0.50, -3.25, 4.32, 1.63, 5.18, -0.43, 7.11, 4.87, -3.10, -5.81, 3.76, 6.31, 2.58, 0.07, 5.76, 3.50) Now, controlA and treatmentA are two numeric data vectors. x=1:10 x=seq(1,10,by=0.5) x=rep(1:10,2) x=rep(1:10,each=2) x=as.character(c(ABC,DEF)) x=as.factor(c(rep(treatment,5),rep(control,5))) How to read and write in R To read in a data file: iris=read.table(~/Desktop/bio-statistics/iris_data.txt,header=T,sep=\t) ~/Desktop/bio-statistics/iris_data.txt” is the file name under the directory: ~/Desktop/bio-statistics/ header=T means the file has a header sep=“\t” means the data separator is the tab “\t” To write data to a file: write.table(iris, ~/Desktop/bio-statistics/iris_data_test.txt,col.names=T,row.names=F,quote=F,sep=\t) Iris data is written to file ~/Desktop/bio-statistics/iris_data_test.txt” while keeping the header without the row.names, without the quotation marks, and with tab “\t” as the separator. R语言中的二项式分布 概率分布:dbinom 分布函数:pbinom 分位数(quantile)函数(分布函数的反函数):qbinom 随机产生器:rbinom R语言中的泊松分布 概率分布:dpois 分布函数:ppois 分位数(quantile)函数(分布函数的反函数):qpois 随机产生器:rpois R语言中的均匀分布 概率分布:dunif 分布函数:punif 分位数(quantile)函数(分布函数的反函数):qunif 随机产生器:runif R语言中的Gamma分布 概率分布:dgamma 分布函数:pgamma 分位数(quantile)函数(分布函数的反函数):qgamma 随机产生器:rgamma Gamma分布 R语言中的指数分布 概率分布:dexp 分布函数:pexp 分位数(quantile)函数(分布函数的反函数):qexp 随机产生器:rexp R语言中的卡方分布 概率分布:dchisq 分布函数:pchisq 分位数(quantile)函数(分布函数的反函数):qchisq 随机产生器:rchisq R语言中的Beta分布 概率分布:dbeta 分布函数:pbeta 分位数(quantile)函数(分布函数的反函数):qbeta 随机产生器:rbeta R语言中的正则分布 密度分布:dnorm 分布函数:pnorm 分位数(quantile)函数(分布函数的反函数):qnorm 随机产生器:rnorm R语言介绍 lapply应用于数组。 tapply 应用于分类数组。 apply 应用于矩阵的分行、分列处理。 R语言介绍 matrix产生矩阵。 rbind 合并行。 cbind 合并列。 Factor产生因子。 数据类型的转换。 R语言介绍 matrix产生矩阵。 rbind 合并行。 cbind 合并列。 Factor产生因子。 数据类型的转换。 data.frame R语言中的描述性画图 hist产生直方图。 boxplot。 barplot。 Pie饼图。 qqn

文档评论(0)

yan698698 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档