由於 Microsoft R 會自己維護一個 CRAN, 會像是一個 Time Machine 紀錄每段期間相容的套件
#On Local Machine Side
##Install Docker Engine, Docker Machine && Docker Compose
###Docker Engine
sudo wget -qO- http://test.docker.com/ | sh
###Docker Machine
Docker Machine Github
wget https://github.com/docker/machine/releases/download/v0.8.0-rc2/docker-machine-`uname -s`-`uname -m` && \
sudo mv docker-machine-`uname -s`-`uname -m` /usr/local/bin/docker-machine && \
sudo chmod +x /usr/local/bin/docker-machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(httr) | |
library(XML) | |
library(dplyr) | |
TWSE <- function(stock="1215",year_in,month_in){ | |
url <- "http://www.twse.com.tw/en/trading/exchange/STOCK_DAY/STOCK_DAY.php" | |
year <- as.numeric(year_in) | |
month <- as.numeric(month_in) | |
query_str <- paste0('myear=', year, '&mmon=', month, | |
'&STK_NO=', stock, '&login_btn=+Query+') | |
res <- POST(url, |
rvest::html_table
需要 importmethods
,稍微查過僅有{xml2}
->{testhat}
->{methods}
- (測試用),在blogger會變白色....
This thread might shed some light on it. It seems that in some contexts RSCRIPT doesn't load package::methods
by default, whereas interactive sessions do load it by default. It seems that the "when" is not clear, but explicitly calling library(methods)
for all RSCRIPT executions seems to be the safe bet: can use package interactively, but Rscript gives errors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Connect to SQL Server using RODBC | |
library(RODBC) | |
library(magrittr) | |
# Connect to SQL Server using RODBC ------------------ | |
sqlHost <- "DAA136209339.sys-sqlsvr.local" | |
sqlDatabase <- "RevoTestDB" | |
dsnString <- "driver={SQL Server};server=%s;database=%s;trusted_connection=true" |
NewerOlder