参考:
1.clifun: 在R里装装逼,现在已经更名rcliutils【Y叔】
https://github.com/GuangchuangYu/rcliutils
2.使用Figlet生成酷炫LOGO
只能在linux 中实现
很久前看到下面图片,软件名称g2gtools,输出到屏幕上,好奇如何实现的。看到y叔推文,大体上知道了。
最后实现效果如下:
[kcao@localhost figlet-2.2.5]$ ./figlet g2gtools
____ _ _
__ _|___ \ __ _| |_ ___ ___ | |___
/ _` | __) / _` | __/ _ \ / _ \| / __|
| (_| |/ __/ (_| | || (_) | (_) | \__ \
\__, |_____\__, |\__\___/ \___/|_|___/
|___/ |___/
步骤:
需要安装三个依赖包,添加到环境变量。
1.figlet :需要修改makefile 文件
wget ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-2.2.5.tar.gz
tar -zxvf figlet-2.2.5.tar.gz
cd figlet-2.2.5
##非root ,需要修改makefile,里面prefix=figlet-2.2.5目录位置
# Where to install files
# prefix = /home/kcao/tools/figlet-2.2.5
make && make install
安装完成后
figlet -f smslant Hutool
__ __ __ __
/ // /_ __/ /____ ___ / /
/ _ / // / __/ _ \/ _ \/ /
/_//_/\_,_/\__/\___/\___/_/
2.lolcat :pip 进行安装
pip install lolcat
3.ydict :命令行版本有道词典
wget https://github.com/TimothyYe/ydict/releases/download/V2.0/ydict-linux64-2.0.tar.gz
添加环境变量后
4.安装rcliutils 包
## install.packages("devtools")
r$> devtools::install_github("GuangchuangYu/rcliutils")
Downloading GitHub repo GuangchuangYu/rcliutils@master
✔ checking for file ‘/tmp/RtmpoX2h5M/remotes1a2a25bc90dbc/GuangchuangYu-rcliutils-ca37eb1/DESCRIPTION’ ...
─ preparing ‘rcliutils’:
✔ checking DESCRIPTION meta-information ...
─ checking for LF line-endings in source and make files and shell scripts
─ checking for empty or unneeded directories
─ building ‘rcliutils_0.0.1.tar.gz’
* installing *source* package ‘rcliutils’ ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rcliutils)
5.其他R包
# 自己加载tidyverse
library(tidyverse)
library("fortunes")
library("cowsay")
# cowsay 文档:https://cran.r-project.org/web/packages/cowsay/vignettes/cowsay_tutorial.html
测试:
可以将代码写到
~/.Rprofile
类似欢迎信息
clifun: 在R里装装逼,现在已经更名rcliutils