Now converts gatkreports to properly typed R data types in gsa.read.gatkreport

-- use the general function type.convert from read.table to automagically convert the string data to booleans, factors, and numeric types as appropriate.  Vastly better than the previous behavior which only worked for numerics, in some cases.
This commit is contained in:
Mark DePristo 2012-03-02 09:11:59 -05:00
parent 0ad7d5fbc1
commit 0a7137616c
1 changed files with 3 additions and 5 deletions

View File

@ -4,11 +4,9 @@
colnames(d) = tableHeader;
for (i in 1:ncol(d)) {
v = suppressWarnings(as.numeric(d[,i]));
if (length(na.omit(as.numeric(v))) == length(d[,i])) {
d[,i] = v;
}
# use the general type.convert infrastructure of read.table to convert column data to R types
v = type.convert(d[,i])
d[,i] = v;
}
usedNames = ls(envir=tableEnv, pattern=tableName);