近日發現有趣的 cowsay 套件, cowsay 是產生ASCII圖片的程式並可顯示一頭牛的訊息 (https://zh.wikipedia.org/wiki/Cowsay)。cowsay 套件內建34種ASCII圖片, 參考以下範例:
> library(cowsay)
> sort(names(animals))
[1] "ant" "anxiouscat" "bat" "bat2" "behindcat"
[6] "bigcat" "buffalo" "cat" "chicken" "clippy"
[11] "cow" "endlesshorse" "facecat" "fish" "frog"
[16] "ghost" "grumpycat" "hypnotoad" "longcat" "longtailcat"
[21] "mushroom" "pig" "poop" "pumpkin" "rabbit"
[26] "shark" "shortcat" "signbunny" "smallcat" "snowman"
[31] "spider" "stretchycat" "trilobite" "yoda"
> library(cowsay)
> sort(names(animals))
[1] "ant" "anxiouscat" "bat" "bat2" "behindcat"
[6] "bigcat" "buffalo" "cat" "chicken" "clippy"
[11] "cow" "endlesshorse" "facecat" "fish" "frog"
[16] "ghost" "grumpycat" "hypnotoad" "longcat" "longtailcat"
[21] "mushroom" "pig" "poop" "pumpkin" "rabbit"
[26] "shark" "shortcat" "signbunny" "smallcat" "snowman"
[31] "spider" "stretchycat" "trilobite" "yoda"
使用 cat(cow) 即可畫出一頭牛的圖案.
使用 say("hello world!") 完成可愛的喵星人 ^_^
新的雞年即將來到, 先祝福R友 - 2017年金雞報喜.
# end