Fork me on GitHub
摘要: cat 猫 怎么就变成一个输出函数了呢? cat 一个输出函数,功能和print有相同之处 我们一起比较看看 1. cat(“hellow world”)或cat('hellow world')输出的是: #hello world 1 print("hellow world")或print('hel 阅读全文
posted @ 2017-04-05 22:01 Mo槑 阅读(14409) 评论(0) 推荐(0) 编辑
摘要: 自定义函数 你可以输出一段代码,创建一个你自己定义的函数 蛋是如果你两个自定义函数的名字重复的话,后面的会把前面的替换掉 举个栗子: hanshu1 <- function(x) sqrt(var) hanshu1 <- function(x ) sqrt(abs) #如果你的函数只有一个函数 就不 阅读全文
posted @ 2017-04-05 15:39 Mo槑 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 生成一个新矩阵,多用一些参数吧这次: x <- c(12,13,14,15) rname <- c("R1","R2") nname <- c("C1","C2") newmatrix <- matrix(x,nrow=2,ncol=2,byrow=TRUE,dimnames=list(rname, 阅读全文
posted @ 2017-04-05 12:43 Mo槑 阅读(312) 评论(0) 推荐(0) 编辑