- 讀取 table format 資料
- read.table
-
sep=
","
,header=F,col.names=
c
(
"age"
,
"type_employer"
,
"fnlwgt"
,
"education"
,
"education_num"
,
"marital"
,
"occupation"
,
"relationship"
,
"race"
,
"sex"
,
"capital_gain"
,
"capital_loss"
,
"hr_per_week"
,
"country"
,
"income"
),
fill=
FALSE
,strip.white=T)
- read.csv
- read.csv2
- read.delim
- read.delim2
http://www.r-tutor.com/r-introduction/data-frame/data-import
https://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html
- 讀取其他系統的資料
- MS-SQL
- 需設定ODBC連線
- 下載ODBC套件 安裝: install.packages("RODBC")library: library(RODB)請參考 : http://dofinotebook.blogspot.tw/2016/01/r-sql-server.html
- EXCEL
https://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html
沒有留言:
張貼留言