發表文章

目前顯示的是有「knitr」標籤的文章

using read.csv to read csv file from website

using read.csv to read csv file from website title = readLines ( "http://www.twse.com.tw/exchangeReport/STOCK_DAY_ALL?response=csv" )[ 1 ] x = read.csv ( "http://www.twse.com.tw/exchangeReport/STOCK_DAY_ALL?response=csv" , skip = 1 ) print 20 entries for example library ( knitr ) cat ( title ) ## "106年11月03日 當日日成交資訊 (股)" kable ( x [ 200 : 220 , 1 : 10 ]) 證券代號 證券名稱 成交股數 成交金額 開盤價 最高價 最低價 收盤價 漲跌價差 成交筆數 200 1470 大統染 0 0 0.00 0.00 0.00 0.00 0.00 0 201 1471 首利 272,683 1,325,502 4.95 4.95 4.84 4.87 +0.02 103 202 1472 三洋紡 109,829 4,202,152 38.20 39.70 37.90 38.15 -0.05 88 203 1473 台南 52,100 1,220,694 23.50 23.50 23.40 23.45 0.00 37 204 1474 弘裕 155,919 1,817,005 11.60 11.70 11.60 11.65 +0.05 31 205 1476 儒鴻 782,081 270,389,640 343.00 349.00 341.00 347.50 +4.50 774 206 1477 聚陽 621,419 ...