forked from SophieKoshkareva/RParserForTable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileIn.R
36 lines (31 loc) · 925 Bytes
/
FileIn.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#' Read row table from .csv-file and create new data.frame as object FileIn slot file_in .
#'
#' @param theObject A FileIn object.
#' @return data.frame \code{x}.
#' @examples
#' myfile <- new("FileIn)
#' myfile <- setFilePath(myfile, "D:/data.csv")
#' myfile <- ReadFileIn(myfile)
FileIn <- setClass("FileIn",
slots = c(table_in = "data.frame"),
contains = "File"
)
setGeneric(name = "ReadFileIn",
def = function(theObject)
{
standardGeneric("ReadFileIn")
}
)
setMethod(f = "ReadFileIn",
signature = "FileIn",
definition = function(theObject)
{
theObject@table_in <- read.csv2(theObject@path,
na.strings = c("", "NA"),
sep = ";",
dec = ",",
stringsAsFactors = FALSE,
check.names = FALSE)
return(theObject)
}
)