Upgrade to Pro — share decks privately, control downloads, hide ads and more …

R & R Studio

hujuu
July 23, 2016

R & R Studio

【第1回】R Business Analysisで使用したRのチュートリアル資料です。RとR Studioのインストール方法や簡単なサンプルコードを載せています。

hujuu

July 23, 2016
Tweet

More Decks by hujuu

Other Decks in Business

Transcript

  1. R Business Analysis ͻͱ·ͣࣗݾ঺հ • Rྺ • 1೥͘Β͍ • େֶ

    3ϲ݄ • ࣾձਓ 8ϲ݄ • ؁ౘ • δϣϒϗούʔٙ࿭ • స৬૬ஊड෇த!! @hujuu
  2. R Business Analysis ൺֱ಺༰ OS Mac,Windows,Linux WindowsϝΠϯ Macͩͱ෼ੳػೳ͕ෆࣗ༝ ॲཧ଎౓ ˚

    X ѻ͑Δσʔλྔ ʓ (150ສߦͷಡΈࠐΈ΋Մೳ) X (1,048,576 ߦɺ16,384 ྻ) ֦ுੑ ʓ ˚ GUI ˚ ʓ Ձ֨ ແྉ ༗ྉʢ݄਺ઍԁʙʣ ར༻༻్ ౷ܭղੳ දܭࢉ΍ࢿྉ࡞੒ͳͲଟ༷
  3. R Business Analysis • ॲཧ଎౓͕༏Ε͍ͯΔͨΊɺେن໛σʔλΛ෼ੳ͢Δࡍ͸ޮ཰త • ExcelͰ͸Ͱ͖ͳ͍౷ܭ෼ੳ͕ग़དྷΔ • ྫ :

    Ϋϥελʔ෼ੳ, όεέοτ෼ੳ(ΞιγΤʔγϣϯ෼ੳ) • ༷ʑͳύοέʔδΛ׆༻͢Δ͜ͱͰ෼ੳͷ෯͕޿͛ΒΕΔ • άϥϑͷඳըʹڧ͍ • ggplot2ͰͷάϥϑԽ͸ࣗ༝౓͕ߴ͘ɺࢹೝੑ͕ߴ͍σβΠϯ ɹɹɹͷओͳϝϦοτ
  4. R Business Analysis ɹɹɹͷΠϯετʔϧ 1. CRANʢThe Comprehensive R Archive NetworkʣʹΞΫηε

    https://cran.r-project.org/ 2. ࢖༻͍ͯ͠ΔOSʹ͋ΘͤͯRͷΠϯετʔϥʔΛμ΢ϯϩʔυ ޙͰ࢖͏ύοέʔδ͕ಈ͔ͳ͍͜ͱ͕ແ͍Α͏ʹ࠷৽൛Λ 3. μ΢ϯϩʔυͨ͠ϑΝΠϧΛ։͍ͯΠϯετʔϧ 4. ΞϓϦέʔγϣϯϑΥϧμʹʮRʯ͕͋Ε͹Πϯετʔϧ׬ྃ
  5. R Business Analysis αϯϓϧίʔυ 2 ^ 5 a <- 100

    b <- 2 a * b list <- c(2,4,6,8,10) list
  6. R Business Analysis ͷΠϯετʔϧ 1. ͍ΘΏΔRͷIDE (౷߹։ൃ؀ڥ)Ͱ͢ɻ RͷεΫϦϓτϑΝΠϧɺ࣮ߦconsoleɺάϥϑεϖʔεɺಡΈࠐΜ ͩσʔλͷҰཡͳͲ͕ݟ΍͘͢഑ஔ͞Ε·͢ 2.

    R studioͷΠϯετʔϥΛμ΢ϯϩʔυ https://www.rstudio.com/products/rstudio/download/ 3. μ΢ϯϩʔυͨ͠ΠϯετʔϥΛ։͍ͯΠϯετʔϧ 4. ΞϓϦέʔγϣϯϑΥϧμʹʮR studioʯ͕͋Ε͹Πϯετʔϧ׬ྃ
  7. R Business Analysis • ίʔσΟϯάதͷೖྗิॿ͕ڧ͍ • άϥϑͷΞ΢τϓοτ͕͠΍͍͢ • ΤσΟλͷจࣈ৭ͱഎܠΛฤू͠ ͯɺݟ΍͍͢ઃఆʹͰ͖Δ

    • ෳ਺ͷεΫϦϓτϑΝΠϧΛλϒͰ ։͍͓͚ͯΔ • ύοέʔδϦετͷӾཡ΍σΟϨΫ τϦϑΝΠϧͷ֬ೝͳͲ͕Ͱ͖Δ ͷϝϦοτ
  8. R Business Analysis άϥϑΛॻ͍ͯΈΑ͏ʂ x <- 1:10 y <- 1:10

    plot(x, y) # x࣠Λ10͔Β1ͷฒͼํʹ͢Δ plot(x, y, xlim=c(10,1))