1 / 52

R: Installation

R: Installation. 林 建 甫 C.F. Jeff Lin, PhD. 台 北 大 學 統 計 系 助 理 教 授 台 北 榮 民 總 醫 院 生 物 統 計 顧 問 美 國 密 西 根 大 學 生 物 統 計 博 士. What is R ?. Statistics package (a GNU project based on the S language) Statistical environment Graphics package Programming language. Let’s look at R.

jwitkowski
Download Presentation

R: Installation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. R: Installation 林 建 甫 C.F. Jeff Lin, PhD. 台 北 大 學 統 計 系 助 理 教 授 台 北 榮 民 總 醫 院 生 物 統 計 顧 問 美 國 密 西 根 大 學 生 物 統 計 博 士 Jeff Lin, MD. PhD.

  2. What is R ? • Statistics package (a GNU project based on the S language) • Statistical environment • Graphics package • Programming language Jeff Lin, MD. PhD.

  3. Let’s look at R Jeff Lin, MD. PhD.

  4. Installing R • www.r-project.org/ • download from CRAN • select a download site • download the base package at a minimum • download contributed packages as needed • Current Version: R-2.3.1 (2006-06-01) Jeff Lin, MD. PhD.

  5. http://http://cran.r-project.org/ Jeff Lin, MD. PhD.

  6. Jeff Lin, MD. PhD.

  7. Jeff Lin, MD. PhD.

  8. Jeff Lin, MD. PhD.

  9. Jeff Lin, MD. PhD.

  10. Jeff Lin, MD. PhD.

  11. R-2.3.1-win32.exe Jeff Lin, MD. PhD.

  12. Jeff Lin, MD. PhD.

  13. R-2.3.1-win32.exe Jeff Lin, MD. PhD.

  14. Jeff Lin, MD. PhD.

  15. Jeff Lin, MD. PhD.

  16. Jeff Lin, MD. PhD.

  17. Jeff Lin, MD. PhD.

  18. 安裝的檔案夾位置 Jeff Lin, MD. PhD.

  19. 安裝的內容, 空間許可下, 全選 Jeff Lin, MD. PhD.

  20. 建立開始功能表單 Jeff Lin, MD. PhD.

  21. 建立捷徑與快述啟動 Jeff Lin, MD. PhD.

  22. Jeff Lin, MD. PhD.

  23. Jeff Lin, MD. PhD.

  24. Jeff Lin, MD. PhD.

  25. Installing R on Windows Jeff Lin, MD. PhD.

  26. Starting and Quitting R • click on the R icon • q() Jeff Lin, MD. PhD.

  27. Jeff Lin, MD. PhD.

  28. Jeff Lin, MD. PhD.

  29. Jeff Lin, MD. PhD.

  30. Getting Help • Getting help > help ( ) # provides help on how to use ‘help’ > help (topic) # provides help on a specific topic > help.start ( ) # brings you to a web interface to the # R documentation Jeff Lin, MD. PhD.

  31. Getting Help Jeff Lin, MD. PhD.

  32. Useful R Function > q() #quit R > help.start() # html help > help # help(lm) get “plot” function detail > ?lm # get “lm” function detail > help.search("linear model") > ls # list objects > rm # rm(xyz) remove “xyz” object Jeff Lin, MD. PhD.

  33. Browse the help > help.start() Jeff Lin, MD. PhD.

  34. > help(lm) > ?lm • Getting help on a specific function Jeff Lin, MD. PhD.

  35. Searching for help > help.search(“linear model”) Jeff Lin, MD. PhD.

  36. Useful R Function > example # Run the example from the help page for an object > data # List the available data sets or import a data set > library # List available packages or attach a package > objects # List the objects in the workspace Jeff Lin, MD. PhD.

  37. Change Working Directory # Create a folder in C:\temp\Rdata first > setwd("C://temp//Rdata") # set new working directory #Create a folder in C:\temp\Rdata\Biost first > setwd("C://temp//Rdata//Biost") #Create a folder in C:\temp\Rdata\Reg first > setwd("C://temp//Rdata//Reg") Jeff Lin, MD. PhD.

  38. Help help ( ) is an R function help.start( ) R functions take arguments (pieces of information that you put into the function which go in between brackets and are separated by commas) and can perform a range of tasks. In the case of the ‘help’ function the task is to display information from the R documentation files. Jeff Lin, MD. PhD.

  39. Online Helps • R FAQ • Mailing Lists (listserv) • Online r-help Jeff Lin, MD. PhD.

  40. r-help Mailing List • Sign up on http://www.r-project.org/ • Think of before sending a question • Read the help/docs first • Add a code example • What version of R Jeff Lin, MD. PhD.

  41. Office Documents Jeff Lin, MD. PhD.

  42. Jeff Lin, MD. PhD.

  43. Contributed Online Documents Jeff Lin, MD. PhD.

  44. Reference Books Jeff Lin, MD. PhD.

  45. Questions?! Jeff Lin, MD. PhD.

  46. What is R? • R系統是由 Ross Ihaka與 Robert Gentleman從 S語言所發展出來, 主要是為了統計分析與繪圖. • S語言早在 1980年代末期, 由 AT&T實驗室,Rick Becker, John Chambers,與 Allan Wilks發展用來進行統計分析與作圖. • Insightful公司將S商品化, 並加入許多方便的操作介面, 稱為 Splus. • R可視為統計數學軟體, 也是一種程式語言. Jeff Lin, MD. PhD.

  47. What is R? • R與 Splus語法大多相近, • 但是 R是一個免費 (open-source, GNU General Public License)的統計分析軟體, 目前由一群跨國際的志工人員組成的 R核心發展組織 (R core-development team)所維持, 運作與持續更新發展. • R 計畫的網址在 http://www.r-project.org在這網址上可獲的更多有關 R的資訊. • R與 S都是以物件導向為主的程式語言, 透過交互作用方式很容易地進行統計分析與繪圖, • 這與 SAS, SPSS的方式有所不同. Jeff Lin, MD. PhD.

  48. What is R? • R is object oriented • Includes many statistical tools • Can be used to share/reproduce analyses • Many new packages being created - can be downloaded and installed easily • Largely text-based interface • Note 1: > is the prompt • Note 2: R is CASE sensitive!! Jeff Lin, MD. PhD.

  49. What is R ? • NOT a statistics software package • NOT menu-driven ? • NOT quick to learn ? Jeff Lin, MD. PhD.

  50. Why R? • R was written by scientists to be used by scientists. • Runs on Windows, Mac, Unix, Linux, ... • Easy to install. • R is free. • Hundreds(!) of packages available. • Papers are often published with a R package. Jeff Lin, MD. PhD.

More Related