Programming for Data Science (I)
1
Introduction
1.1
Install R/RStudio
1.2
Install packages
2
R Basics
2.1
What are R and RStudio?
2.2
Environment setup
2.2.1
Project
2.2.2
Start a project in RStudio
2.2.3
RStudio
2.2.4
R
2.3
R Script/R Markdown
2.3.1
Code chunk
2.3.2
Sidebar and bottom menu
2.4
Basic data type
2.5
Collection of values
2.6
Values and element values
2.7
Retrieve ONE element value by Position
2.8
Binding
2.9
Concatenate
2.10
List
2.11
Sampled data
2.11.1
Observation by observation
2.11.2
Feature by feature
2.12
Named element values
2.13
Retrieve element value by element name
2.14
list only $ extractor
3
Element Values
3.1
More on list
3.1.1
JSON data
3.2
Retrieve multiple element values
3.3
Replacement
3.4
Add element values
3.4.1
How to
3.4.2
Data construction
3.4.3
Data construction example
3.5
Remove element values
3.6
Example on data.taipei
3.6.1
Download .csv approach
3.6.2
API approach
3.6.3
Saving your data
4
Operations on Atomic Vectors
4.1
Class
4.2
Common classes of object value
4.2.1
Character, numeric, logical
4.2.2
Factor
4.2.3
Date/Time
4.2.4
Data frame
4.2.5
Matrix
4.3
Class conversion
4.3.1
list to atomic vector
4.3.2
atomic vector to list
4.3.3
among atomic vectors
4.4
Programming Block
4.5
Pipe Operator
4.5.1
|>
4.5.2
%<>%
and
%T>%
4.6
Operations on atomic vectors
4.6.1
Comparison
4.6.2
Pick and Which
4.6.3
Multiple conditions
4.6.4
Common situations on different vectors
4.7
Summarise one vector
4.8
Exercise
1. John Doe
2. LINE fraud
3. Drug
4. Econ survey
5. WDI
5
Programming Design
5.1
For each
5.1.1
For each observation
5.1.2
Information container
5.1.3
For loop
5.1.4
For each group
5.2
Systematic analysis
5.2.1
Function as reusable programming block
5.2.2
Function on search path
5.2.3
Environments
5.2.4
Input arguments
5.2.5
Advanced Concept of Environments
5.2.6
Extract function
5.2.7
Function usage and default
5.3
Task by situation
5.3.1
if
5.3.2
else if
5.3.3
else
5.3.4
&&
and
||
5.4
An example
6
Road map
7
dplyr
7.1
Package features
7.2
An example
7.2.1
Summarise
7.2.2
Create a new feature: mutate
7.2.3
For each group
7.2.4
Sort by column
7.2.5
Subsample
國立臺北大學 經濟學系
Programming for Data Science (I)
Chapter 6
Road map
經濟系資料科學課程地圖
「經濟模型程式設計專題」為研究所課程,大三、大四學生前一學期成績平均達80分者可提出上修。