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

2018-09-20 上課前可以準備的動作

  1. Windows 使用者請檢查自己的使用者名稱有沒有中文
  2. 安裝R (可以從 CRAN 安裝最新版的R,或是從 MRAN 安裝舊版的R)
  3. 安裝 Rstudio
  4. 打開 [Rstudio]
  5. 依照指南,安裝 R語言翻轉教室

2018-09-20 上課後的動作

---
title: "Deep Censored Quantile Regression"
author: "Wush Wu"
date: "September 7, 2018"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
```
#include <Rcpp.h>
#include <thread>
using namespace Rcpp;
//[[Rcpp::export]]
void testInterrupt(const int jsize, bool verbose, const int out_index = 0) {
std::ostream* pout;
if (out_index == 0) pout = &Rcout;
else if (out_index == 1) pout = &std::cout;
else throw std::invalid_argument("out");
library(magrittr)
library(RSQLite)
library(parallel)
library(dplyr)
library(data.table)
.tbs <- dbListTables(db) %>%
grep(pattern = "^cem_", value = TRUE)
cl <- makeCluster(length(.tbs))
init.cluster <- function(cl) {
parallel:::checkCluster(cl)
jenkins ALL=(ALL) NOPASSWD:ALL
argv <- commandArgs(TRUE)
pkgs <- strsplit(argv, ",")[[1]]
installed.pkgs <- dir(.libPaths()[1])
for(pkg in pkgs) {
if (pkg %in% installed.pkgs) next
utils::install.packages(pkg, lib = .libPaths()[1])
}
@wush978
wush978 / README.md
Last active May 17, 2018 05:50
CS+X R程式語言與資料處理 最後一次的作業說明

這次的作業希望讓同學能準備做期末專題,所以將圍繞著老師給同學的示範專題作練習。 請同學先重現 http://homepage.ntu.edu.tw/~wush978/rdataengineer/demo.html 中的分析結果之後,應該要具備以下的幾個變數:

  • cec.df
  • ias.df
  • join.df

老師希望同學能透過和資料互動,回答以下的問題:

  • 為什麼有些資料比對不到?(1%)
@wush978
wush978 / README.md
Last active May 2, 2018 17:26
HW3 ~ HW5 的加分題

下載檔案

所得稅稅務資料

  • 政府資料開放平台上搜尋:「綜合所得稅各類所得金額各縣市鄉鎮村里統計表-縣市別」,可以得到一個彙整搜尋結果的檔案:
    • 請處理這個檔案,得到每個縣市的下載連結
  • 請在R中寫迴圈下載22個檔案

中選會投票資料

@wush978
wush978 / README.md
Last active April 19, 2018 06:00
R程式語言與資料處理 作業說明

安裝作業的步驟

  1. 安裝R,用Windows的同學請安裝Rstudio
  2. 按照以下的指引安裝R語言翻轉教室與NTUR02
    1. 輸入source("http://homepage.ntu.edu.tw/~wush978/R/init-swirl.R")source("https://wush978.github.io/R/init-swirl.R")來安裝安裝R語言翻轉教室,細節可以參考安裝指引
    2. 輸入swirl::install_course_url("http://homepage.ntu.edu.tw/~wush978/R/course/NTUR02.zip")來安裝NTUR02。這個步驟每週都要更新。
  3. 收信
    • 請確認你的信箱(<學號>@ntu.edu.tw 或你登錄在ceiba上的信箱)有收到老師寄的標題為:[R程式語言與資料處理]作業帳號密碼的信
      • 信中有classroom帳號的帳號密碼
  4. 作業請用classroom帳號完成,我才知道你是誰