Skip to content

MAC 在產生文字雲圖形出現亂碼的狀況處理方式分享 #28

@rugbyball

Description

@rugbyball

今日參與 DSC2015 R課程時,我根據閃電秀中 R Text Mining的步驟想產生文字雲

由於我的 OS 是 Mac, 但依照投影片步驟執行後,圖形中的文字雲中文無法顯示

http://nbviewer.ipython.org/format/slides/github/whizzalan/RTextMining/blob/gh-pages/lightingTalk/lightingTalk.ipynb#/6

經過助教的協助

發現在產生文字雲圖形前,要先執行以下程式碼

par(family=(“Heiti TC Light”))

接著再執行產生文字雲語法

wordcloud(d$word,d$freq, scale=c(6,0.5), min.freq=mean(d$freq),
max.words=100, random.order=FALSE, rot.per=.01, colors=pal2)

產生文字雲圖形時,中文就可正確顯示

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions