Learn R Programming

GREA (version 1.0)

GREA_read: Read Data Wrapper

Description

Reads Data of many different formats. Currently: .dta (STATA), .sav (SPSS), .mat (MATLAB), .xls/.xlsx (Excel), and .raw, .csv, .txt, .asc, .dat. Is the basis-function for the GREA add-in.

Usage

GREA_read(filelocation, header = FALSE, sep = " ", dec = ".", sheetIndex = 1, na.values, skip = 0, encoding = "unknown")

Arguments

filelocation
A single string with the location and name of the file, e.g. “data/blabla.csv”
header
A logical indicating whether a text-delimited file contains a header row.
sep
A character string specifying a column separator.
dec
A character string specifying a decimal separator.
sheetIndex
A numerical value to indicate which sheet to import (Excel formats).
na.values
A character string specifying which values to convert to NA's. while importing. Can be a vector of values when reading text-delimited files (read.table), and should be a single value when importing Excel files (read_excel).
skip
How many rows should be skipped? Only for text-delimited files and Excel files.
encoding
Encoding of text-delimited files (see read.table)

Value

A dataframe, containing the read-in data plus the code to read the data as an attribute.