comparison dfhlp.R @ 6:b8f70d8216b3 draft

planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit b3a4e34cf9356447ae3507cc6fe2ff6a1f24afbc-dirty
author prog
date Mon, 27 Mar 2017 06:27:29 -0400
parents 3afe41d3e9e7
children
comparison
equal deleted inserted replaced
5:18254e8d1b72 6:b8f70d8216b3
40 ##################### 40 #####################
41 41
42 df.move.col.last <- function(df, cols) { 42 df.move.col.last <- function(df, cols) {
43 not.cols <- setdiff(names(df), cols) 43 not.cols <- setdiff(names(df), cols)
44 df[c(not.cols, cols)] 44 df[c(not.cols, cols)]
45 }
46
47 ##############
48 # READ TABLE #
49 ##############
50
51 df.read.table <- function(file, sep = "", header = TRUE, remove.na.rows = TRUE, check.names = TRUE, stringsAsFactors = TRUE, trim.header = FALSE, trim.values = FALSE, fileEncoding = "") {
52
53 # Call built-in read.table()
54 df <- read.table(file, sep = sep, header = header, check.names = check.names, stringsAsFactors = stringsAsFactors, fileEncoding = fileEncoding)
55
56 # Clean data frame
57 df <- df.clean(df, trim.colnames = trim.header, trim.values = trim.values, remove.na.rows = remove.na.rows)
58
59 return(df)
60 } 45 }
61 46
62 ################# 47 #################
63 # READ CSV FILE # 48 # READ CSV FILE #
64 ################# 49 #################