Friday, June 01, 2018

Importing and Exporting data set in R


It is easy to import and export data set in R using package 'rio'


  1. install.package("rio")
  2. library(rio)
  3. ## set working directory
  4. dir1 = "path to working directory such as c://.." 
  5. setwd(dir1)
  6. data <- import("example.csv")
  7. ##The same data set can be exported to SAS dataset
  8. export(data, "example.sas7bdat")

## Some of the Supported data set are 
  1. csv
  2. xls
  3. xlsx
  4. sav
  5. sas7bdat
  6. rds

No comments: