Learn R Programming

RTextTools (version 1.3.2)

read_data: reads data from files into an R data frame.

Description

Reads data from several types of data storage types into an R data frame.

Usage

read_data(filename, tablename = NULL, type = c("csv", "tab", "accdb", "mdb"),
...)

Arguments

filename
Character string of the name of the file, include path if the file is not located in the working directory.
tablename
Microsoft Access database only. The table name in the database.
type
Character vector specifying the file type. Options include "csv", "tab", "accdb", "mdb" to denote .csv files, text files, or Access databases.
...
Other arguments passed to read_data.

Value

  • An data.frame object is returned with the contents of the file.

Examples

Run this code
library(RTextTools)
data <- read_data(system.file("data/NYTimes.csv.gz",package="RTextTools"),type="csv")

Run the code above in your browser using DataLab