read_data: Read data with multi-byte separator

Description Usage Arguments Value Examples

Description

Read in data set which is seperated with multi-byte symbol. This function creates workaround for data.table::fread function by replacing multi-byte symbol with single-byte symbol and then uses built-in functions.

Usage

1
read_data(filepath, sep, sbyte_sep = "\t", header = TRUE)

Arguments

filepath

character string. Desciption to connection object

sep

string. Description of multi-byte seperator. Single-byte seperator also can be used.

sbyte_sep

string. Single byte seperator that will be used to replace multi-byte seperator. Default is \t.

header

logical. Does data contain header.

Value

data.frame of read in data set

Examples

1
2
3
4
#MovieTweetings dataset from sidooms github project 
df <- read_data(filepath=paste0("https://raw.githubusercontent.com/sidooms/",
                                "MovieTweetings/master/latest/movies.dat"),
          sep="::", sbyte_sep = "~", header=FALSE) 

agritag/infeR documentation built on June 8, 2019, 7:43 p.m.