- 請安裝java:
- Windows / Mac 請到 https://java.com 下載java並安裝到系統之中
- Ubuntu:
sudo apt-get install openjre-default
- 請安裝Google Chrome 或更新Google Chrome(版本至少要60以上)
- 安裝
rJava
- 測試看看安裝有沒有成功:
- 在R中輸入:
library(rJava);.jinit()
- 在R中輸入:
- 安裝 RSelenium 與 httr 套件
- 初始化 RSelenium 套件:請在R console輸入:
library(RSelenium);rD <- rsDriver()
,R應該會自動下載需要的檔案
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
test : | |
Rscript test.R |
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
def fixed_add(a): | |
def add(b): | |
return a + b | |
return add | |
adder = fixed_add(1) | |
# list variable names in the closure | |
adder.__code__.co_freevars | |
# access variables in the closure |
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
# event on time | |
y1 <- rnorm(100) | |
# left censored | |
y2 <- rnorm(100) - rexp(100) | |
Y <- Surv( | |
time = c(y1, y2), | |
event = c(rep(1, length(y1)), rep(0, length(y1))), | |
type = "right") | |
# The intercept is biased |
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
# 回覆 <https://www.ptt.cc/bbs/R_Language/M.1514527291.A.C47.html> | |
## 改自原問題的程式碼 | |
### 產生測試資料 | |
```{r} | |
library(magrittr) | |
p.combination = character(1000) |
- 請依照 安裝導引上的說明安裝R語言翻轉教室
- Windows 使用者帳戶如果包含中文,請參考Windows中文使用者與Rstudio的環境變數調校更改電腦設定
- 請依照
shu<學號>
/ 學號末三碼 登入帳號- 舉例來說,學號為
b01234567
的同學,登入帳號為shub01234567
密碼為567
- 舉例來說,學號為
- 如果帳號尚未開通得同學,請在下課找我,並且先用Google或Facebook帳號登入
- 完成 DataScienceAndR 中01-RBasic-*, 02-RDataEngineer-*, 03-RVisualization-*中的所有單元,全部完成獲得100分,每少一個單元扣10分
- 於
2017-12-19 24:00:00
之前每完成所有單元的同學可獲得滿分 - 若某一個單元晚一天完成,該單元的分數會少20%。舉例來說:若同學於期限內差一個單元完成所有單元,但是於
2017-12-21 21:00:00
再完成最後一個單元,則分數為 90 + 10 * 60% = 96 - 同學可於 個人紀錄 上查詢進度。老師會以這裡查到的進度為準。同學如果發生完成作業但查不到進度的狀況,並儘速通知老師: [email protected] 。
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(magrittr) | |
library(dplyr) | |
library(forecast) | |
get.df <- function(path) { | |
df <- read.csv(gzfile(path), header = TRUE, colClasses = c("character", "numeric", "integer")) | |
df.gossiping <- df[df$X.board == "Gossiping",] | |
class(df.gossiping$timestamp) <- class(Sys.time()) | |
df2 <- mutate(df.gossiping, hr = format(timestamp, "%Y-%m-%d %H:00:00") %>% as.POSIXct()) %>% | |
group_by(hr) %>% | |
summarise(count.avg = mean(count), count.sd = sd(count), n = length(count)) %>% |
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
--- | |
title: "Bug" | |
output: | |
flexdashboard::flex_dashboard: | |
orientation: rows | |
social: menu | |
runtime: shiny | |
--- | |
```{r global, include=FALSE} |
- 安裝R語言翻轉教室
- 安裝課程HahowRTutorial
- 安裝課程NTUR01
請參考 安裝導引 的指示安裝R語言翻轉教室