Re: [問題] 讀入"鴴" "鸊鷉" 等怪字
※ 引述《celestialgod (攸藍)》之銘言:
: ※ 引述《helixc (@_2;)》之銘言:
: # readxl套件: (不用JAVA,讀取也比較快,也不會轉換字串為factor)
: library(readxl)
: dat = read_excel("birdnames.xls")
這邊報告一下... readxl這個套件沒問題,
但用dplyr處裡資料的時候就會有問題。
[code]
library(readxl)
library(dplyr)
fileName = "birdnames.xls"
#讀取資料
x = read_excel(fileName)
#資料讀取輸出正常
x$c_name[51:52]
#使用dplyr::select來讀資料,用兩種不同的寫法,一樣都不正常
y1<-select(x, c_name, Order) ; y1[51:52,]
y2<- x %>% select(c_name, Order) ; y2[51:52,]
#使用base::unique來讀取資料,正常
z<-unique(x$c_name); z[51:52]
還不太會貼code以及處裡過程,直接貼圖
http://imgur.com/7oOVkLm
不正常的資料
Source: local data frame [2 x 2]
c_name Order
1 白嘴潛鳥 51
2 小<U+9E0A><U+9DC9> 52
正常的資料
[1] "白嘴潛鳥" "小鸊鷉"
如果是package處裡的問題的話,那轉移到非windows系統是無解的吧?
只能捨棄dplyr使用*apply來輸出名錄了...
可是我還不會用*apply來寫dplyr-like的功能阿Orz
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 223.138.151.129
※ 文章網址: https://www.ptt.cc/bbs/R_Language/M.1436113381.A.EAB.html
→
07/06 00:38, , 1F
07/06 00:38, 1F
→
07/06 00:39, , 2F
07/06 00:39, 2F
→
07/06 00:39, , 3F
07/06 00:39, 3F
→
07/06 01:04, , 4F
07/06 01:04, 4F
→
07/06 01:04, , 5F
07/06 01:04, 5F
→
07/06 01:05, , 6F
07/06 01:05, 6F
→
07/06 01:11, , 7F
07/06 01:11, 7F
→
07/06 01:11, , 8F
07/06 01:11, 8F
→
07/06 01:12, , 9F
07/06 01:12, 9F
→
07/06 01:13, , 10F
07/06 01:13, 10F
→
07/06 01:13, , 11F
07/06 01:13, 11F
→
07/06 01:13, , 12F
07/06 01:13, 12F
→
07/06 01:15, , 13F
07/06 01:15, 13F
→
07/06 01:17, , 14F
07/06 01:17, 14F
→
07/06 01:17, , 15F
07/06 01:17, 15F
→
07/06 01:31, , 16F
07/06 01:31, 16F
→
07/06 01:32, , 17F
07/06 01:32, 17F
→
07/06 01:32, , 18F
07/06 01:32, 18F
→
07/06 01:32, , 19F
07/06 01:32, 19F
→
07/06 01:32, , 20F
07/06 01:32, 20F
→
07/06 01:33, , 21F
07/06 01:33, 21F
推
07/06 01:53, , 22F
07/06 01:53, 22F
→
07/06 01:55, , 23F
07/06 01:55, 23F
→
07/06 01:56, , 24F
07/06 01:56, 24F
→
07/06 03:20, , 25F
07/06 03:20, 25F
推
07/06 17:11, , 26F
07/06 17:11, 26F
→
07/06 17:12, , 27F
07/06 17:12, 27F
→
07/06 17:13, , 28F
07/06 17:13, 28F
→
07/06 21:26, , 29F
07/06 21:26, 29F
→
07/06 21:27, , 30F
07/06 21:27, 30F
→
07/06 21:27, , 31F
07/06 21:27, 31F
→
07/06 21:27, , 32F
07/06 21:27, 32F
→
07/06 21:28, , 33F
07/06 21:28, 33F
→
07/06 21:28, , 34F
07/06 21:28, 34F
→
07/06 21:29, , 35F
07/06 21:29, 35F
→
07/06 21:29, , 36F
07/06 21:29, 36F
→
07/06 21:29, , 37F
07/06 21:29, 37F
推
07/06 22:13, , 38F
07/06 22:13, 38F
→
07/07 00:21, , 39F
07/07 00:21, 39F
→
07/07 00:22, , 40F
07/07 00:22, 40F
→
07/07 00:23, , 41F
07/07 00:23, 41F
→
07/07 00:46, , 42F
07/07 00:46, 42F
→
07/07 00:46, , 43F
07/07 00:46, 43F
→
07/07 00:46, , 44F
07/07 00:46, 44F
→
07/07 00:46, , 45F
07/07 00:46, 45F
→
07/07 00:47, , 46F
07/07 00:47, 46F
→
07/07 01:24, , 47F
07/07 01:24, 47F
→
07/07 08:08, , 48F
07/07 08:08, 48F
→
07/07 08:08, , 49F
07/07 08:08, 49F
→
07/07 08:10, , 50F
07/07 08:10, 50F
→
07/07 08:10, , 51F
07/07 08:10, 51F
討論串 (同標題文章)
R_Language 近期熱門文章
PTT數位生活區 即時熱門文章