Skip to content

Instantly share code, notes, and snippets.

View wush978's full-sized avatar
👶
Working with my baby

Wush Wu wush978

👶
Working with my baby
View GitHub Profile
test :
Rscript test.R
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
# 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
# 回覆 <https://www.ptt.cc/bbs/R_Language/M.1514527291.A.C47.html>
## 改自原問題的程式碼
### 產生測試資料
```{r}
library(magrittr)
p.combination = character(1000)
  • 請安裝java:
    • Windows / Mac 請到 https://java.com 下載java並安裝到系統之中
    • Ubuntu: sudo apt-get install openjre-default
  • 請安裝Google Chrome 或更新Google Chrome(版本至少要60以上)
  • 安裝rJava
  • 測試看看安裝有沒有成功:
    • 在R中輸入:library(rJava);.jinit()
  • 安裝 RSelenium 與 httr 套件
  • 初始化 RSelenium 套件:請在R console輸入:library(RSelenium);rD <- rsDriver(),R應該會自動下載需要的檔案

安裝須知

帳號須知

  • 請依照 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
  • 同學可於 個人紀錄 上查詢進度。老師會以這裡查到的進度為準。同學如果發生完成作業但查不到進度的狀況,並儘速通知老師: wush@arbor.ee.ntu.edu.tw
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)) %>%
@wush978
wush978 / bug.Rmd
Created October 6, 2017 12:10
The second tab under page "Bug is Here" does not work properly.
---
title: "Bug"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
runtime: shiny
---
```{r global, include=FALSE}
@wush978
wush978 / ntu1061r1_1.md
Last active September 18, 2019 13:24
台大 R程式語言入門 與 R程式語言與資料處理 的安裝作業須知

安裝作業

  1. 安裝R語言翻轉教室
  2. 安裝課程HahowRTutorial
  3. 安裝課程NTUR01

安裝R語言翻轉教室

請參考 安裝導引 的指示安裝R語言翻轉教室