• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

R语言-赞你包_praise包

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
(2017-07-08 银河统计)

前言

  praise包就一个功能:赞你!

目录

 1. praise包安装

 2. praise包开启赞你模式


1. praise包安装

# 直接安装:
	install.packages("praise")

# 从github上安装:
	library(devtools)
	install_github("gaborcsardi/praise")

2. praise包开启赞你模式

# 用法:
	praise(template = "You are ${adjective}!")

# 使用随机的单词替换adjective来赞美你!
	> library(praise)
	> praise()
	[1] "You are fine!"
	> praise()
	[1] "You are divine!"
	> praise()
	[1] "You are best!"
	> praise()
	[1] "You are fantastic!"
	> praise()
	[1] "You are wonderful!"
	> praise()
	[1] "You are fantabulous!"
	> praise()
	[1] "You are splendid!"


# 自定义赞美格式

	# 可以看到,预设的赞美格式是You are ${adjective}!,此外还可以自定义格式!

	## 首字母大写
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Yay! This program is lovely!"
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Gee! This package is glorious!"
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Yahoo! This program is super!"
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Mhm! This package is fantastic!"
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Yippie! This project is fine!"
	> praise("${Exclamation}! This ${rpackage} is ${adjective}!")
	[1] "Ahh! This R package is super!"

	## 所有字母大写
	> praise("${EXCLAMATION}! You have done this ${adverb_manner}!")
	[1] "HUZZAH! You have done this really!"
	> praise("${EXCLAMATION}! You have done this ${adverb_manner}!")
	[1] "AHHH! You have done this enthusiastically!"
	> praise("${EXCLAMATION}! You have done this ${adverb_manner}!")
	[1] "HURRAY! You have done this warmly!"
	> praise("${EXCLAMATION}! You have done this ${adverb_manner}!")
	[1] "OLE! You have done this kindly!"
	> praise("${EXCLAMATION}! You have done this ${adverb_manner}!")
	[1] "HO-HO! You have done this swiftly!"

# 其中 ${EXCLAMATION} 、${adjective}以及 ${adverb_manner},可以理解为包中的词库,分别表示感叹和情态,每个词库里面都含有数量不等的用于称赞你的词语!

# 查看可用词库:

	> names(praise_parts)
	[1] "adjective" "adverb" "adverb_manner" "created" "creating" "exclamation" "rpackage" 

参考资料


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
R语言——linux离线安装R包 - 萧飞IDO发布时间:2022-07-18
下一篇:
R语言安装包:非零状态的处理发布时间:2022-07-18
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap