參考:
1.clifun: 在R里裝裝逼宵蛀,現在已經更名rcliutils【Y叔】
https://github.com/GuangchuangYu/rcliutils
2.使用Figlet生成酷炫LOGO
只能在linux 中實現
很久前看到下面圖片走孽,軟件名稱g2gtools,輸出到屏幕上榆浓,好奇如何實現的∪踉簦看到y叔推文蒸苇,大體上知道了。
最后實現效果如下:
[kcao@localhost figlet-2.2.5]$ ./figlet g2gtools
____ _ _
__ _|___ \ __ _| |_ ___ ___ | |___
/ _` | __) / _` | __/ _ \ / _ \| / __|
| (_| |/ __/ (_| | || (_) | (_) | \__ \
\__, |_____\__, |\__\___/ \___/|_|___/
|___/ |___/
步驟:
需要安裝三個依賴包,添加到環(huán)境變量吮旅。
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
添加環(huán)境變量后
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