import: import

Description Usage Arguments Details Value See Also Examples

View source: R/import.R

Description

Imports a data frame from a data file with the file format based on the file extension

Usage

1

Arguments

file

An optional character string naming a path to a file. By default, the user will be prompted to choose a file.

...

additional arguments passed to the function.

Details

This function imports a data frame from a data file with the file format based on the file extension. import supports a variety of file extensions including SAS (.sas7bdat), Stata (.dta), SPSS (.sav), Excel (.xls and .xlsx), Comma-separated data (.csv), and Tab-separated data (.tsv). If the file path is not specified, import will prompt the user to choose a file.

Value

A Dataframe

See Also

read_spss,read_excel,vroom,read_sas

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
# import XLS or SAV as a `data.frame`
df = import("mtcars.xls")
df = import("mtcars.sav")

# pass arguments to underlying import function
df = import("mtcars.dta",nmax = 5)

## End(Not run)

malneyadi4/dsproject documentation built on Jan. 1, 2021, 8:30 a.m.