1 of 19

Week 4

程式相關概念整理

2 of 19

目前為止實習課講過的工具...

Terminal

R Console

RStudio

R Markdown

Lab 01

Lab 02

Text�Editor

(VS Code)

3 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

4 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

5 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

*.R�*.Rmd�*.md�*.html�*.sh

Programming Language (PL)

6 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

*.R�*.Rmd�*.md�*.html�*.sh

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

Programming Language (PL)

Script

7 of 19

Running a Program

執行

Text�Editor

PL

Script

Interpreter�(直譯器)

動作

  • 數學運算
  • 字串處理
  • 寫入檔案�...

8 of 19

Running a Program: R Script

Script

Text�Editor

PL

hello.R

Interpreter�(直譯器)

執行

動作

  • 數學運算
  • 字串處理
  • 寫入檔案�...

R Interpreter

9 of 19

Running a Program

執行

Text�Editor

PL

Script

Compiler�(編譯器)

Interpreter�(直譯器)

動作

  • 數學運算
  • 字串處理
  • 寫入檔案�...

Script

10 of 19

Running a Program: Compiling Markdown

Script

Script

Text�Editor

PL

hi.md

Compiler�(編譯器)

執行

hi.html

Pandoc

Interpreter�(直譯器)

動作

  • 數學運算
  • 字串處理
  • 寫入檔案�...

11 of 19

人與機器之間的互動界面

執行

Text�Editor

PL

Script

Compiler�(編譯器)

Interpreter�(直譯器)

動作

  • 數學運算
  • 字串處理
  • 寫入檔案�...

Script

Interface

12 of 19

Two kinds of Interfaces

Command-Line Interface

Interpreter�(直譯器)

動作

R 指令

回饋 (執行結果)

R Console�(Interface)

執行

SPSS 後端�EXCEL 後端

動作

滑鼠

回饋 (執行結果)

SPSS 界面�Excel 界面

執行

程式指令

13 of 19

Two kinds of Interfaces

Command-Line Interface

Graphical User Interface

Interpreter�(直譯器)

動作

R 指令

回饋 (執行結果)

R Console�(Interface)

執行

SPSS 後端�EXCEL 後端

動作

滑鼠

回饋 (執行結果)

SPSS 界面�Excel 界面

執行

程式指令

14 of 19

Terminal

動作�(調動電腦上的其它程式)

Interpreter�(直譯器)

shell / cmd 指令

回饋 (執行結果)

Terminal�(Interface)

執行

桌面後端

滑鼠

回饋 (執行結果)

桌面環境�(Interface)

執行

程式指令

動作�(調動電腦上的其它程式)

15 of 19

Terminal

動作�(調動電腦上的其它程式)

Command-Line Interface

Interpreter�(直譯器)

shell / cmd 指令

回饋 (執行結果)

Terminal�(Interface)

執行

Graphical User Interface

桌面後端

滑鼠

回饋 (執行結果)

桌面環境�(Interface)

執行

程式指令

動作�(調動電腦上的其它程式)

16 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

*.R�*.Rmd�*.md�*.html�*.sh

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

Programming Language (PL)

Script

17 of 19

The World of Programming is Full of Jargons

R Language�R Markdown�Markdown �HTML�bash (zsh)

Terminal�R Console�Text Editor�VS Code�RStudio�git�GitHub�GitHub Desktop

*.R�*.Rmd�*.md�*.html�*.sh

Programming Language (PL)

Script

18 of 19

Git & GitHub

Commit history

hw2

2021/3/13�14:07

hw2

2021/3/16�14:58

hw2

2021/3/16�17:43

git commit

git commit

git commit

(雲端服務)

git push

git pull

個人電腦

雲端

GitHub Desktop�(Git GUI 界面)

其它電腦�(e.g. 助教的電腦)

Commit history

hw2

hw2

hw2

2021/3/13�14:07

2021/3/16�14:58

2021/3/16�17:43

git clone

19 of 19

Thank You!