今日精神涣散,适宜玩耍。 用几个包做点好玩的,感谢Y叔,徐洲更。
首先安装几个包
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")
myqrcode.jpeg
文字
ggqrcode("Things can only get better.")
Things can only get better.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)
qrcode_image.jpeg
install.packages('fun')
library(fun)
if (.Platform$OS.type == "windows")
x11() else x11(type = "Xlib")
扫雷
mine_sweeper()
五子棋(没事自己下五子棋。有个小bug,赢着不能自动结束)
gomoku()
image.png
生成随机密码
random_password(length = 8)
"#pONbPW("