import_dataset {eHDPrep}R Documentation

Import data into 'R'

Description

Imports a rectangular single table into R from a .xls, .xlsx, .csv, or .tsv file.

Usage

import_dataset(file, format = "excel", ...)

Arguments

file

Character constant. Path to file.

format

Character constant. "excel" (default, for .xls or.xlsx files), csv", or "tsv".

...

Parameters to pass to read_excel, read_csv or read_tsv

Details

First row is interpreted as column headers by default. For more details see read_excel (.xlsx/.xls), read_csv (.csv), or read_tsv (.tsv).

Value

data as a tibble

See Also

read_excel for additional parameters for importing .xls or .xlsx files, read_csv for .csv files, read_tsv for .tsv files

Other import to/export from 'R' functions: export_dataset()

Examples

## Not run: 
   # This code will not run as it requires an xlsx file
   # ./dataset.xlsx should be replaced with path to user's dataset
   
   # excel
   import_dataset(file = "./dataset.xlsx", format = "excel")
   #csv
   import_dataset(file = "./dataset.csv", format = "csv")
   #tsv
   import_dataset(file = "./dataset.tsv", format = "tsv")

## End(Not run)


[Package eHDPrep version 1.3.3 Index]