今日精神涣散,适宜玩耍。
用几个包做点好玩的,感谢Y叔,徐洲更。
1 R生成二维码
首先安装几个包
install.packages("ggimage")
install.packages("devtools")
install.packages("qrcode")
devtools::install_github("GuangchuangYu/yyplot")
require(ggplot2)
require(ggimage)
require(yyplot)
网站
ggqrcode("https://mp.weixin.qq.com/s/TMmsOsEn0wV9yXKOLma3Rw")
![](https://img.haomeiwen.com/i7976641/0b4e9bbf2a04f337.jpeg)
文字
ggqrcode("Things can only get better.")
![](https://img.haomeiwen.com/i7976641/f91e83384539148a.jpeg)
二维码中加图片
pg <- ggqrcode("https://www.jianshu.com/u/51a71446d509")
d <- data.frame(x=15, y=15,
img="https://upload.jianshu.io/users/upload_avatars/7976641/dbd6256c-70d1-4e44-9bee-86da39f598a9.png?imageMogr2/auto-orient/strip|imageView2/1/w/240/h/240")
pg + geom_image(aes(x,y, image=img), data=d, size=.2)
![](https://img.haomeiwen.com/i7976641/2bfa61cfac60f789.jpeg)
2 fun package
install.packages('fun')
library(fun)
if (.Platform$OS.type == "windows")
x11() else x11(type = "Xlib")
扫雷
mine_sweeper()
五子棋(没事自己下五子棋。有个小bug,赢着不能自动结束)
gomoku()
![](https://img.haomeiwen.com/i7976641/1c194cb6317b278a.png)
生成随机密码
random_password(length = 8)
"#pONbPW("
网友评论