Your SlideShare is downloading. ×
0
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Reading Data into R REVISED
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Reading Data into R REVISED

33,165

Published on

Published in: Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
33,165
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
46
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Reading data into REVISED 2012-10-05@HSPH Kazuki Yoshida, M.D. MPH-CLE student FREEDOM TO  KNOW
    • 2. Previously in this groupn Introduction to Rn Reading Data into R (1) Group Website: http://rpubs.com/kaz_yos/useR_at_HSPH
    • 3. Menun Configuring RStudion Installing/Loading packagesn Reading text files inn Reading excel files inn (Reading other files in)
    • 4. Ingredients Statistics Programmingn None n Install/Load packages n read.____() functions n <- (assignment)
    • 5. http://mediacrushllc.com/2012/internet-statistics-2012/ is the study of thecollection, organization, analysis, interpretation, and presentation of data http://en.wikipedia.org/wiki/Statistics
    • 6. Supportedn .RData (native): load()n .csv & text files: read.csv(), etcn .xls/.xlsx: library(gdata) or library(xlsx)n .sas7bdat: read.sas7bdat() via library(sas7bdat)n .dta: read.dta via library(foreign)n and more... http://cran.r-project.org/doc/manuals/R-data.html
    • 7. Create a folder for this study group This will be your working directory.
    • 8. Firstconfigure Studio
    • 9. OpenR Studio
    • 10. WorkspaceConsole Plot
    • 11. Tools-Options
    • 12. Restart RStudioafter cofiguration
    • 13. Working directory? Folder your are working in
    • 14. CRANmirror
    • 15. Comprehensive R You get additional Archive functionalities from here! Networkhttp://cran.r-project.org/web/packages/ available_packages_by_date.html
    • 16. Createa script
    • 17. Source WorkspaceConsole Plot
    • 18. Installadditionalpackages
    • 19. Install packages! foreign sas7bdat XML gdata xlsx
    • 20. programmingway to load it Click to loadlibrary(gdata) packages
    • 21. Use text filesuch as csv if possible
    • 22. Download comma-separated and Excel Put them in folderBONEDEN.DAT.txtBONEDEN.DAT.xls http://www.cengage.com/cgi-wadsworth/course_products_wp.pl? fid=M20bI&product_isbn_issn=9780538733496
    • 23. For comma-, tab-, orspace-separated text, GUI is available
    • 24. Text
    • 25. name of a dataset here file name herebone <- read.csv(“BONEDEN.DAT.txt”) function to read .csv files
    • 26. Excel next
    • 27. Use gdata package library(gdata)bone <- read.xls(“BONEDEN.DAT.xls”)
    • 28. Use xlsx package library(xlsx)bone <- read.xlsx(“BONEDEN.DAT.xls”, sheetIndex = 1)
    • 29. Never type all Always hit TAB http://www.clickykeyboards.com/index.cfm/fa/ items.main/parentcat/10191/subcatid/0/id/179764
    • 30. Never type all F1 for help Always hit TAB http://www.clickykeyboards.com/index.cfm/fa/ items.main/parentcat/10191/subcatid/0/id/179764
    • 31. Follow on-site instructions
    • 32. library(foreign) bone <- read.xport(“BONEDEN.DAT.xpt”) or library(sas7bdat)bone <- read.sas7bdat(“BONEDEN.DAT.sas7bdat”)
    • 33. library(foreign)bone <- read.dta(“BONEDEN.DAT.dta”)
    • 34. HTML table! http:// www.drugs.com/ top200_2003.html
    • 35. library(XML)drug2003 <- readHTMLTable("http://www.drugs.com/ top200_2003.html", which = 2, skip.rows = 1)
    • 36. Menun Configuring RStudion Installing/Loading packagesn Reading text files inn Reading excel files inn (Reading other files in)
    • 37. Ingredients Statistics Programmingn None n Install/Load packages n read.____() functions n <- (assignment)

    ×