68th Tokyo.R Beginner session1

68th Tokyo.R Beginner session1

第68回Tokyo.Rの初心者セッション1:data import/exportのスライドです。

8284465a94bbdf1ea82cf1a67d55f447?s=128

kilometer

March 03, 2018
Tweet

Transcript

  1. 1.

        @kilometer BeginneR Session 1 -- Data

    Import / Export -- 2018.03.03 at Shiodome
  2. 3.

    Who   @kilometer  Postdoc (Ph.D engineering)  

    Animal Behavior Neuro Imaging Medical Engineering R ~ 10 years?  : 
  3. 8.

    Input Output Today’s talk ? ? Table data Image data

    Other formats Introduction Summary
  4. 9.

    !   #      $"

         $    $    
  5. 10.

    #  %       &$

      ! & ! &  "       
  6. 11.

       !    "  

      "  "   
  7. 12.

       !    "  

      "  "   
  8. 19.
  9. 21.

    RStudio > Project .H21474836474<: G RStudio 7@ ,R&-%("#+!')0FC ,')JA!3? ,')6=!("#+!3<

    RStudio!E1  ฤू్தͷ಺༰Λอ࣋  D5921474836472R*-$-QOL!;8/ BI >   34UVEJPͬͯͳΜͩʁ 1SPKFDUͬͯͳΜͩ !XBLVUFLB https://qiita.com/wakuteka/items/9599bb0a8985d98928d7
  10. 22.

    RStudio > Project R   +(  .'"& 

    #%"$ RStudio)!  *- , #%"&   34UVEJPͬͯͳΜͩʁ 1SPKFDUͬͯͳΜͩ !XBLVUFLB https://qiita.com/wakuteka/items/9599bb0a8985d98928d7
  11. 24.
  12. 26.

    Input Output Today’s talk ? ? Table data Image data

    Other formats Summary Introduction
  13. 28.

    Table format data Comma-separated values (.csv) Tab-separated values (.tsv) Space-SV

    Semicolon-SV … Delimiter-separated values or Character-SV
  14. 29.

           Import Table format

    data object assignment operator file path function
  15. 30.

           Import Table format

    data object assignment operator file path function
  16. 31.

    ~/Documents/ import.txt  data      

               or 1. set working directory 2. then use relative path Method②: use absolute path Method ① Import Table format data
  17. 33.

    prj ~/Documents/R prj.Rproj import.txt Default working directory (project root) 

          can use relative path without  
  18. 36.

    ) ! ( ) ! ! ( ) ∖ #

    " !( !! ! (( # ! (( # ! (( # " ( ! # " ( ( ( () # ( ( ) ( # () # ( ! ! (( ( # ( ( # " ( !! ! # ! # ( ( () ) ! # ! # ( ( "" #) !! ( ( ! ( () # ( ( ) ( !) () # ( ( ) ( ! # # # # # # # ) ,) ( ! Import Table format data
  19. 37.

    ) ! ( ) ! ! ( ) ∖ #

    " !( !! ! (( # ! (( # ! (( # " ( ! # " ( ( ( () # ( ( ) ( # () # ( ! ! (( ( # ( ( # " ( !! ! # ! # ( ( () ) ! # ! # ( ( "" #) !! ( ( ! ( () # ( ( ) ( !) () # ( ( ) ( ! # # # # # # # ) ,) ( ! Import Table format data
  20. 38.

      Usage read.table(file, skip = 0, header = FALSE,

    nrows = -1, row.names, fileEncoding = "") Import Table format data
  21. 39.

    cf. R-Tips: 40.     http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html  

                  Import Table format data
  22. 40.

    " " " " " cf. R-Tips: 40.  

      http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
  23. 41.

    " " " " " cf. R-Tips: 40.  

      http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
  24. 42.

    " " " " " cf. R-Tips: 40.  

      http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
  25. 43.

    " " " " " cf. R-Tips: 40.  

      http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data
  26. 44.

    " " " " " cf. R-Tips: 40.  

    # $ http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data # &_"# $ # " # "/!  # %"
  27. 45.

    " " " " " cf. R-Tips: 40.  

    # $ http://cse.naro.affrc.go.jp/takezawa/r-tips/r/40.html Import Table format data # &_"# $ # " # "/!  # %"
  28. 47.

             

      ∖        Import Table format data Wrap
  29. 54.

    Package Default pkgs Package Package Package CRAN Guithub Package Package

    Package Package Package Package Package Package       
  30. 55.

         Import Table format data Default

    installed pkg (optional) Function     Install REQUIRED
  31. 57.

    Import Table format data      

     Installation (from CRAN)     Usage          or
  32. 59.

    Import Table format data      

            Fast!!! Flexible!!! Need installation Should specify: data.table =FALSE Automatic!!! Simple!!!
  33. 60.

             

       object file path Export Table format data Wrapper
  34. 61.

    Input Output Today’s talk ? ? Table data Image data

    Other formats Summary Introduction
  35. 64.

    Export image data Use Graphic Device ready graphic device close

    graphic device draw graph(s) plotting functions High-level Low-level Interactive Basic Graphics in R http://bcb.dfci.harvard.edu/~aedin/courses/BiocDec2011/2.Plotting.pdf
  36. 65.

    Export image data Use Graphic Device ready close draw 

             High-level plotting function
  37. 68.

    Export image data Graphic Devices in    

                          
  38. 69.

      ready graphic device close graphic device draw graph(s)

    Image data processing Import & Export image        processing
  39. 72.

      Import image data     

          
  40. 73.

      Import image data     

          
  41. 74.

    Import image data       

        Export image data       # not CRAN pkg       # low googlability !
  42. 75.

    Import image data       

        Export image data       # not CRAN pkg       # low googlability !
  43. 76.
  44. 77.
  45. 78.
  46. 81.
  47. 82.
  48. 83.

    Input Output Today’s talk ? ? Table data Image data

    Other formats Summary Introduction
  49. 85.
  50. 87.
  51. 88.

    .sas or .dta or .sav SAS Stata SPSS  

                      
  52. 93.

    Data Import / Export ? ?    

                       packages
  53. 96.
  54. 97.