吳齊軒/漫談 R 的學習挑戰與 R 語言翻轉教室

Post on 21-Apr-2017

6.883 views 1 download

Transcript of 吳齊軒/漫談 R 的學習挑戰與 R 語言翻轉教室

R R R R Wush WuTaiwan R User Group

R

2/80

http://spectrum.ieee.org/computing/software/the-2015-top-ten-programming-languages

3/80

http://myfootpath.com/careers/engineering-careers/statistician-careers/

4/80

http://www.r-bloggers.com/mapping-the-worlds-biggest-airlines/

5/80

http://r4stats.com/2013/03/19/r-2012-growth-exceeds-sas-all-time-total/

6/80

7/80

http://img.diynetwork.com/DIY/2003/09/18/t134_3ca_med.jpg

8/80

R

R

R

R

·

·

·

9/80

https://docs.oracle.com/cd/B28359_01/datamine.111/b28129/process.htm

10/80

R

11/80

http://globalebc.mx/cooperation-program

12/80

https://docs.oracle.com/cd/B28359_01/datamine.111/b28129/process.htm

13/80

http://img.diynetwork.com/DIY/2003/09/18/t134_3ca_med.jpg

14/80

http://www.youtube.com/watch?v=OCQU6M4pPiw

15/80

17/80

[1] "TWII"

TWII.OPEN TWII.HIGH TWII.LOW TWII.CLOSE TWII.VOLUME TWII.ADJUSTED

7871.41 7937.26 7843.60 7920.80 5710600 7920.777

7954.96 7999.42 7917.30 7917.30 5951400 7917.277

7929.89 7955.90 7901.24 7934.51 5717400 7934.487

7940.20 7942.23 7821.71 7835.57 5181400 7835.547

7778.57 7797.57 7736.11 7736.71 4292400 7736.688

7778.38 7827.93 7778.38 7790.01 4516000 7789.987

library(quantmod)getSymbols("^TWII")head(TWII)

18/80

: AirbnB uses R to scale datascience

Rbnb

Airbnb's engineering, data science, analytics and user

experience teams

Hadoop / SQL R Missing Data

·

·

·

·

500+

How Airbnb uses Machine Learning to Detect Host

Preferences

How well does NPS predict rebooking?

-

-

-

19/80

Reproducible Research·

R Markdown

Jupyter ir-kernel

-

-

20/80

21/80

22/80

R

R ·

·

23/80

R R

24/80

http://joelcadwell.blogspot.tw/2013/03/lets-do-some-hierarchical-bayes-choice.html

25/80

R

GUI

R

·

·

R (help)-

·

·

·

·

26/80

R

R

R

·

R -

·

R R

-

-

27/80

R

R ·

R

-

-

-

28/80

·

-

29/80

·

-

·

copy paste

-

-

30/80

31/80

ptt R_Language·

·

32/80

Estimate NA

Beta Beta

Intercept,data[,2],data[,3],data[,i],data[,j],data[,i]:data[,j]

33/80

[ ]:

Oracle ( big5)

DBMSencoding

[ ]:

con <- odbcConnect(dsn, uid = "", pwd = "", DBMSencoding="big5")

34/80

R

UseMethod("xmlNamespaceDefinitions") : 'xmlNamespaceDefinitions' "NULL"

35/80

[ ]:

R ( SAS)

.DAT 65 40

R

read.delim() XD

~

36/80

21

( 21 )

sample(52)cards<-sample(52)num<-cards%%13num

(52\13 )

?

37/80

38/80

39/80

·

·

·

40/80

R ·

·

-

-

41/80

R

42/80

http://radiusonline.com/interns/my-first-month-at-radiusonline/learn-by-doing/

43/80

·

-

-

·

45/80

01-RBasic-02-Data-Structure-Vectors

# 87 91year1 <- 87:91power1 <- c(6097059332, 6425887925, 6982579022, 7323992602.53436, 7954239517) # 87 91power2 <- c(59090445718, 61981666330, 67378329131, 66127460204.6482, 69696372914.6949)

# (`year1`) `7e9` # `7e9` R `7 * 10^9`

year1.answer1 <- < >

# 87 91power1.mean <- < >

46/80

02-RDataEngineer-01-Parsing

# <http://data.gov.tw/node/7769> # # # # R pirate_info <- readLines(file(pirate_path, encoding = < encoding>))

47/80

02-RDataEngineer-06-Join

#' `gdp_path` `gdp`#' `gdp_path` / GDP( )

...

#' cl_info mortgage_bal data_dt#' cl_info `cl_info_year`

...

#' `gdp` `cl_info`#' gdp mortgage_total_bal / gdp

48/80

·

vignettes

help

-

-

example

-

-

49/80

R

·

-

·

·

50/80

00-Hello-DataScienceAndR

01-RBasic

02-RDataEngineer

03-RVisualization

Optional-Programming

Project-ROpenData

·

·

·

·

·

·

51/80

Hello DataScienceAndR

swirl

·

-

-

-

·

52/80

R Basic

R

R

·

·

·

·

53/80

R Data Engineer

·

API Server JSON

-

-

-

-

·

·

54/80

R Visualization

ggplot2

googleVis ggmap

·

·

·

55/80

Hello World·

·

56/80

58/80

2016-02-13 2016-07-15

1238

9528

5301

·

·

·

·

59/80

60/80

61/80

R62/80

R

tracking server

·

-

·

-

63/80

64/80

65/80

http://www.effectivephilanthropy.org/qa-improving-application-and-reporting-processes/

66/80

67/80

Swirl Project

lesson.yaml

swirl

·

-

-

-

·

https://github.com/swirldev/swirl/compare/master...wush978:master-

- Class: meta Course: DataScienceAndR Lesson: 00-Hello-DataScienceAndR Author: Wush Wu Type: Standard Organization: Taiwan R User Group

68/80

69/80

cmd_question

- Class: cmd_question Output: `chol2inv` CorrectAnswer: help(chol2inv) AnswerTests: any_of_exprs("?chol2inv", "help(chol2inv)") Hint: `?` `help`

70/80

71/80

mult_question

- Class: mult_question Output: | assignment R console `a - 1` AnswerChoices: 1;2;" ";"4" CorrectAnswer: 1 AnswerTests: omnitest(correctVal= '1')

72/80

73/80

script

- Class: script Output: | `submit()` Rstudio File -> Reopen With Encoding... -> UTF-8 Script: RBasic-02-HW.R AnswerTests: rbasic_02_hw_test()

74/80

75/80

DataScienceAndR/ 01-RBasic-02-Data-Structure-Vectors/ customTests.R initLesson.R lesson.yaml scripts/ RBasic-02-HW.R RBasic-02-HW-correct.R

76/80

Tests

omnitest

any_of_exprs

My implementations:

·

·

·

https://github.com/wush978/swirl/blob/master/R/answerTests3.R-

77/80

Installation

https://github.com/wush978/R/blob/gh-pages/init-swirl.R

78/80

Q&A79/80

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

·

·

·

·

80/80