KH.loadCSV: Load data from a CSV file into 'data.table'

Description Usage Arguments Details Value Note See Also Examples

View source: R/DataSet.R

Description

Load data from a CSV file into 'data.table'

Usage

1
2
KH.loadCSV(csv_filename, key = NULL, index = NULL, colClasses = NULL,
  ...)

Arguments

csv_filename

string. Full URL to the CSV file.

key

atomic or vector of string. Name of fields used in the keys. NOT Used for now.

index

atomic or vecotr of string. Name of fields used in indexing data. NOT Used for now.

colClasses

list of named strings. Name and classes of fields used to read and load data. NOT Used for now.

...

Dots. An arbitrary number and variety of arguments, passing arguments on to fread

Details

Use only data of data.table type. Many functions of this package work with this type of data only.

Value

data.table. An object of type data.table

Note

All the functions in this package accept data.table only.

See Also

Other DataSets: KH.changeColName, KH.dropColsByName, KH.loadXlsx

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
{
input_file <- system.file("extdata", "input_file.csv", package = "KHanSUtils")
KH.loadCSV(input_file)

#   year month  day dep_delay arr_delay carrier origin dest air_time distance hour
# 1: 2014     1   1        14        13      AA    JFK  LAX      359     2475    9
# 2: 2014    10  31         1       -30      UA    LGA  IAH      201     1416   14
# 3: 2014     1   1        -3        13      AA    JFK  LAX      363     2475   11
# 4: 2014    10  31        -5       -14      UA    EWR  IAH      189     1400    8
# 5: 2014     1   1         2         9      AA    JFK  LAX      351     2475   19
# 6: 2014    10  31        -8        16      MQ    LGA  RDU       83      431   11
# 7: 2014     1   1        -8       -26      AA    LGA  PBI      157     1035    7
# 8: 2014    10  31        -4        15      MQ    LGA  DTW       75      502   11
# 9: 2014     1   1         2         1      AA    JFK  LAX      350     2475   13
#10: 2014    10  31        -5         1      MQ    LGA  SDF      110      659    8
#11: 2014     1   1         4         0      AA    EWR  LAX      339     2454   18
}

ks465/r-utils documentation built on May 23, 2019, 5:07 p.m.