Re: [問題] 9/15 slides

看板NTUIM-lckung作者 (小傑)時間9年前 (2014/09/19 20:04), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串2/2 (看更多)
※ 引述《rose9429 (路易絲)》之銘言: : 老師好, : 抱歉9/15 slide有關後面R的部分有一小段不太能理解,想請問一下: 不用客氣~ 回答問題是我應該做的. : P. 42/51 : How about these? : > head(cbind(W$Channel, W$Region)) : > head(cbind(Channel = W$Channel, Region = W$Region)) : 跑出結果: : [,1] [,2] : [1,] 1 1 : [2,] 1 1 : [3,] 1 1 : [4,] 1 1 : [5,] 1 1 : [6,] 1 1 : cbind的功能到底是? : --------------------- : 謝謝! cbind() 會把 vector 以 matrix 中的 column 形式表現出來. 比如說把 cbind() 拿掉的話: > head(W$Channel) 妳就會看到 [1] 1 1 1 1 1 1 但加上 cbind(): > head(W$Channel) [,1] [1,] 1 [2,] 1 [3,] 1 [4,] 1 [5,] 1 [6,] 1 也就是說, cbind() 會把傳進 cbind() 的 vector 轉成 column 然後 bind 在一起. 妳也試試 rbind(), 就會看到大家都是串成一個 row (然後有點難閱讀 XD) 這樣有瞭解了嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.106.147 ※ 文章網址: http://www.ptt.cc/bbs/NTUIM-lckung/M.1411128281.A.B5C.html

09/20 01:01, , 1F
Got it,thanks...just watched ur four vedios,good to
09/20 01:01, 1F

09/20 01:02, , 2F
understand basic things...
09/20 01:02, 2F

09/20 13:21, , 3F
Thank you~ Let me know if you have any question.
09/20 13:21, 3F
文章代碼(AID): #1K71lPjS (NTUIM-lckung)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
文章代碼(AID): #1K71lPjS (NTUIM-lckung)