IMPORT DATASET IN R
SUBMITTED ON
P.PRIYADHARSHINI
II-MSC(IT)
DEPARTMENTOF CS&IT
NADAR SARASWATHI COLLEGE OF ARTS&SCIENCE, THENI
IMPORT DATA IN R
• Read csv
• Excel
• Spss
• Stata
• Sas file
•
READ CSV
• The most widely Data store Is the .csv(comma separate
value) File Format.r loads an arrays Of libraries during startup ,
inCludingutils package. Package is convenient to open csv
Files combined with the reading .csv()function
• Syntax:
• Read.csv(file, header=TRUR, sep=“, “)
ARGUMENT:
• File:path file is stored
• Header:confirm file header or the header is set toTrue
• Sep:symboll used spit variable.default,‘, ‘.
• Read the data mtcats csv file store online path needs string value
READ EXCEL FILES
• Excel files are very popularamong dataanalysts.spreadsheeteasy to work flexible. R is equippeflibrary
readxl import excel spreadsheet.
• Code:
• Require (readxl)
• Output:
• Loading required package :readxl.
• Package does not exit, installconda library or terminal , conda install –c mittner r-readxl
• Load library to import excel files
• Library(readxl)
READ EXAMPLE ()
• Readxl_example()
• Readxl_example(“geometry.xls”)
IMPORT DATA FROM OTHER STATISTICAL SOFTWARE
• Import different files format with heaven packages.this package.packagesupport SAS, STATA and SPSS
software
• sAS:read_sas()
• STATA:read_dta() or read_stata() identical
• SPSS:read_sav()or read_por().check extension.
• Ready to open all files from SAS, STATA and SPSS.
READ SAS EXAMPLE
• Df<-read_sas(PATH_sas)
• Head(df)
• Output
• <dbl> <dbl> <dbl> <dbl>
• 1 0 380 3.61 3
• 2 1 660 3.67 3
• 3 1 800 4.00 1
• 4 1 640 3.19 4
• 5 0 520 2.93 4
• 6 1 760 3.00 2
READ STATA
• Df<-read_dta(PATH_stata)
• Head(df)
• Output:
• # <dbl> <dbl> <dbl> <dbl>
• 1 0 380 3.61 3
• 2 1 800 4.00 3
READ SPSS
• Df<-read_saV(PATH_spss)
• Head(df)
• Output:
• # <dbl> <dbl> <dbl> <dbl>
• 1 0 380 3.61 3
• 2 1 660 3.67 3
BEST PRACTICE DATA IMPORT
Bigdata
Bigdata
Bigdata
Bigdata

Bigdata

  • 1.
    IMPORT DATASET INR SUBMITTED ON P.PRIYADHARSHINI II-MSC(IT) DEPARTMENTOF CS&IT NADAR SARASWATHI COLLEGE OF ARTS&SCIENCE, THENI
  • 2.
    IMPORT DATA INR • Read csv • Excel • Spss • Stata • Sas file •
  • 3.
    READ CSV • Themost widely Data store Is the .csv(comma separate value) File Format.r loads an arrays Of libraries during startup , inCludingutils package. Package is convenient to open csv Files combined with the reading .csv()function • Syntax: • Read.csv(file, header=TRUR, sep=“, “)
  • 4.
    ARGUMENT: • File:path fileis stored • Header:confirm file header or the header is set toTrue • Sep:symboll used spit variable.default,‘, ‘. • Read the data mtcats csv file store online path needs string value
  • 5.
    READ EXCEL FILES •Excel files are very popularamong dataanalysts.spreadsheeteasy to work flexible. R is equippeflibrary readxl import excel spreadsheet. • Code: • Require (readxl) • Output: • Loading required package :readxl. • Package does not exit, installconda library or terminal , conda install –c mittner r-readxl • Load library to import excel files • Library(readxl)
  • 6.
    READ EXAMPLE () •Readxl_example() • Readxl_example(“geometry.xls”)
  • 7.
    IMPORT DATA FROMOTHER STATISTICAL SOFTWARE • Import different files format with heaven packages.this package.packagesupport SAS, STATA and SPSS software • sAS:read_sas() • STATA:read_dta() or read_stata() identical • SPSS:read_sav()or read_por().check extension. • Ready to open all files from SAS, STATA and SPSS.
  • 8.
    READ SAS EXAMPLE •Df<-read_sas(PATH_sas) • Head(df) • Output • <dbl> <dbl> <dbl> <dbl> • 1 0 380 3.61 3 • 2 1 660 3.67 3 • 3 1 800 4.00 1 • 4 1 640 3.19 4 • 5 0 520 2.93 4 • 6 1 760 3.00 2
  • 9.
    READ STATA • Df<-read_dta(PATH_stata) •Head(df) • Output: • # <dbl> <dbl> <dbl> <dbl> • 1 0 380 3.61 3 • 2 1 800 4.00 3
  • 10.
    READ SPSS • Df<-read_saV(PATH_spss) •Head(df) • Output: • # <dbl> <dbl> <dbl> <dbl> • 1 0 380 3.61 3 • 2 1 660 3.67 3
  • 11.