RR
Wush Wu
R
R
R
R
R Rstudio
R
R
swirl R
·
·
·
·
·
·
·
·
00: R
02:
-
-
2/75
R
3/75
R
http://myfootpath.com/careers/engineering-careers/statistician-careers/
4/75
R
http://www.r-bloggers.com/mapping-the-worlds-biggest-airlines/
5/75
R
http://r4stats.com/2013/03/19/r-2012-growth-exceeds-sas-all-time-total/
6/75
R
7/75
R
http://img.diynetwork.com/DIY/2003/09/18/t134_3ca_med.jpg
8/75
R
R
R
·
·
9/75
R
10/75
-
·
·
11/75
-
plot(density(x))·
12/75
-
shaprio.test(x)
·
Shapiro-Wilk normality test
data: x
W = 0.93385, p-value = 8.287e-05
13/75
-
·
plot(density(x1), xlim = range(c(x1, x2)), main = "Sample PDF")
lines(density(x2), col = 2)
legend("topright", c("x1", "x2"), lty = 1, col = 1:2)
14/75
-
15/75
-
ks.test(x1, x2)·
Two-sample Kolmogorov-Smirnov test
data: x1 and x2
D = 0.2, p-value = 0.2719
alternative hypothesis: two-sided
16/75
- A/B
A 10000 10
B 5000 3
/
·
·
·
·
17/75
- A/B
R
·
A B
10000 10
- 3/5000
-
·
# A 3 / 5000
p <- 3/5000
# 1000 10000 A
plot(density(x <- rbinom(1000, 10000, p)))
18/75
- A/B
·
19/75
- A/B
mean(x > 10)·
[1] 0.046
20/75
- A/B
·
library(binom)
binom.confint(c(10, 3), c(10000, 5000), methods = "exact")
method x n mean lower upper
1 exact 10 10000 1e-03 0.0004796397 0.001838264
2 exact 3 5000 6e-04 0.0001237515 0.001752444
21/75
- A/B
paper·
·
22/75
R
23/75
-
R·
-
24/75
-
suppressPackageStartupMessages(library(PerformanceAnalytics))
chart.Correlation(iris[-5], bg=iris$Species, pch=21)
25/75
-
round(Ca <- cor(attitude), 2)
symnum(Ca) # simple graphic
heatmap(Ca, symm = TRUE, margins = c(6,6))
26/75
-
·
R-
27/75
-
data(edhec)
chart.ACFplus(edhec[,1,drop=FALSE])
28/75
-
29/75
R
30/75
R
·
·
-
-
-
·
API
-
-
·
31/75
ChihChengLiang: R Crawler 2015·
32/75
R·
Google Sheets R API
Google Map
Excel
Minitab, S, SAS, SPSS, Stata, Systat and Weka...
DBI
-
-
-
-
-
33/75
--
[1] "TWII"
TWII.OPEN TWII.HIGH TWII.LOW TWII.CLOSE TWII.VOLUME TWII.ADJUSTED
7871.41 7937.26 7843.60 7920.80 5710600 7920.80
7954.96 7999.42 7917.30 7917.30 5951400 7917.30
7929.89 7955.90 7901.24 7934.51 5717400 7934.51
7940.20 7942.23 7821.71 7835.57 5181400 7835.57
7778.57 7797.57 7736.11 7736.71 4292400 7736.71
7778.38 7827.93 7778.38 7790.01 4516000 7790.01
library(quantmod)
getSymbols("^TWII")
head(TWII)
34/75
-
chartSeries(TWII, subset = "last 4 months", TA = c(addVo(), addBBands()))
35/75
-
YEARID NAME RANK W L R RA
1871 Boston Red Stockings 3 20 10 401 303
1871 Chicago White Stockings 2 19 9 302 241
1871 Cleveland Forest Citys 8 10 19 249 341
1871 Fort Wayne Kekiongas 7 7 12 137 243
1871 New York Mutuals 5 16 17 302 313
1871 Philadelphia Athletics 1 21 7 376 266
library(Lahman)
head(Teams[,c("yearID", "name", "Rank", "W", "L", "R", "RA")])
36/75
-
37/75
-
PLAYERID YEARID W L ERA
wangch01 2005 8 5 4.02
wangch01 2006 19 6 3.63
wangch01 2007 19 7 3.70
wangch01 2008 8 2 4.07
wangch01 2009 1 6 9.64
wangch01 2011 4 3 4.04
38/75
-
suppressPackageStartupMessages({
library(jiebaR) #
library(tm) #
library(slam) #
library(wordcloud) #
library(topicmodels) #
library(igraph) #
})
39/75
-
Sheng-Wei Chen ,
/
2014
40/75
-
Sheng Wei Chen
2014
41/75
-
42/75
Shiny
Gallery:
·
·
K-means Example-
43/75
API Server
OpenCPU
APP:
·
·
Stocks-
44/75
SparkR
RHadoop
MPI
·
·
·
Rmpi
pbdMPI
-
-
45/75
R Community
R Rstudio
R
R Community R swirl
·
Hadley Wickham R-
·
46/75
Hadley R
PACKAGE DOWNLOADS
1 Rcpp 208987
2 ggplot2 182208
3 stringr 168142
4 stringi 167407
5 plyr 166594
6 digest 158068
7 magrittr 156989
8 scales 152784
9 reshape2 147723
10 RColorBrewer 140949
R Hadley·
47/75
R
·
Taiwan R User Group
ptt R_Language
R
-
-
-
48/75
R Rstudio
49/75
R
R
Rstudio
·
·
50/75
R
Windows: CRAN R3.2·
3.0.2 3.2
-
-
51/75
R
Mac: CRAN R3.2·
R
-
-
52/75
R
Ubuntu: Ubuntu 14.04 CRAN·
http://cran.csie.ntu.edu.tw/bin/linux/ubuntu/README.htm-
53/75
Rstudio
Rstudio·
Rstudio
Windows UTF-8
-
-
54/75
Rstudio
·
·
·
·
55/75
RStudio
>
"hello world" Enter
1 + 1 Enter
1 + Enter
+
Ctrl + C ESC >
me Enter
me tab
·
·
·
·
·
·
·
56/75
RStudio
R Script
me Ctrl + Enter
me me
tab
·
·
·
·
57/75
RStudio
·
58/75
R
59/75
R
60/75
R
Rstudio
library( )
·
·
·
61/75
swirl R
62/75
swirl
swirl windows·
Taiwan R User Group-
#
install.packages(c('swirl', 'curl'), repos = 'http://taiwanrusergroup.github.io/R')
63/75
swirl
library(swirl)
library(curl)
64/75
swirl
swirl() #
R swirl
·
·
65/75
swirl
swirl
swirl
swirl
·
·
·
install_course_github("wush978", "DataScienceAndR", "course")
·
66/75
swirl DataScienceAndR
·
67/75
swirl
Windows
·
·
·
68/75
·
R
Rstudio(
)
Taiwan R User Group
DataScienceAndR
-
-
-
-
69/75
1. RBasic-01-Introduction
2. RBasic-02-Data-Structure-Vectors
3. RBasic-03-Data-Structure-Object
4. RBasic-04-Factors
5. RBasic-05-Arrays-Matrices
6. RBasic-06-List-DataFrame
7. RBasic-07-Loading-Dataset
·
70/75
RBasic-01-Introduction
< >.zip
ceiba
·
RBasic-02-HW.R
RBasic-03-HW.R
RBasic-04-HW.R
RBasic-05-HW.R
RBasic-06-HW.R
RBasic-07-HW.R
-
-
-
-
-
-
·
71/75
< >.zip·
d01921016/
d01921016/RBasic-02-HW.R
d01921016/RBasic-03-HW.R
d01921016/RBasic-04-HW.R
d01921016/RBasic-05-HW.R
d01921016/RBasic-06-HW.R
d01921016/RBasic-07-HW.R
submit()·
72/75
...
bug
https://github.com/wush978/DataScienceAndR/issues
windows
·
...
sessionInfo()
-
-
·
73/75
Q&A
74/75
R vs Python
Choosing R or Python for data analysis? An infographic
Pros and Cons of R vs Python Sci-kit learn
Which is better for data analysis: R or Python?
How to Choose Between Learning Python or R First
·
·
·
·
75/75

R 語言上手篇