1 / 6

Topic #4 – input/output ‏

http://www.sciencedaily.com/releases/2008/09/080902143245.htm. Topic #4 – input/output ‏. 1. Input Set working directory Read a script Read a text file 2. Output Write a text file. http://www.sciencedaily.com/releases/2008/09/080902143245.htm. Topic #4 – input/output ‏. 1. Input

Télécharger la présentation

Topic #4 – input/output ‏

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. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 1. Input • Set working directory • Read a script • Read a text file • 2. Output • Write a text file

  2. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 1. Input • Set working directory • Method #1 • file > change dir... • Method #2 • file.path should look like ... setwd(file.path) “C://...//”

  3. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 1. Input • Set working directory • Method #1 • [ file > change dir... ]

  4. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 1. Input • Read a script • file.path should be specified similar to setwd( )‏ source(file.path)

  5. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 1. Input • Read a text file • Options • Header – can save column names at top of file • Separator – can change the character that separates values DATA = read.table(file = file.path , ...)

  6. http://www.sciencedaily.com/releases/2008/09/080902143245.htmhttp://www.sciencedaily.com/releases/2008/09/080902143245.htm Topic #4 – input/output‏ • 2. Output • Write a text file write.table(Data, file = file.path , ...)

More Related