6、R语言,调用自编函数
来源:互联网 发布:建筑工程造价软件 编辑:程序博客网 时间:2024/05/18 07:29
#选择日期的格式
mydate <- function(type = "long"){
switch(type,
long = format(Sys.time(), "%A %B %d %Y"),
short = format(Sys.time(), "%m-%d-%y"),
cat(type, "is not a recognized type\n")
)
mydate <- function(type = "long"){
switch(type,
long = format(Sys.time(), "%A %B %d %Y"),
short = format(Sys.time(), "%m-%d-%y"),
cat(type, "is not a recognized type\n")
)
}
上面为自编函数,保存为mydate.R文件
调用:
> source("mydate.R")
> mydate("long")
[1] "星期二 三月 24 2015"
> mydate("short")
[1] "03-24-15"
> mydate("")
is not a recognized type
0 0
- 6、R语言,调用自编函数
- R语言中函数定义与调用
- 自编printf 函数
- 自编scanf函数
- 自编字符串函数
- 自编串口打印函数
- R 语言 调用自己写的其他函数(.R文档间调用)
- JAVA调用R语言
- python调用R语言
- c#调用R语言
- JAVA调用R语言
- Python调用R语言
- java 调用R语言
- JAVA调用R语言
- Java调用R语言
- JAVA调用R语言
- R语言调用rlm函数生成稳建回归模型
- 自编的VB6.0调用WinAPI的模块(整合了许多函数和过程)
- Palindrome Number
- 权限对目录的重要性
- Win7系统自带的无线网络共享WIFI
- 力所能及之hibernate简单的增删查改
- 开源游戏引擎详解
- 6、R语言,调用自编函数
- 给定字符串,求出现次数最多的那个字母及次数,如有多个重复则都输出
- 流媒体一
- UI中常用的控件Slider\SegmentCtrl\PageCtrl
- URAL 2012. About Grisha N.
- poj 3070(矩阵快速幂)
- live555类关系图
- 02引言-AngularJS基础教程
- Codeforces Round #296 (Div. 2) C(STL_set)