importDataFromSBDF(file = NULL, keep = character(0), drop = character(0), startRow = 1, endRow = -1, rowNamesCol = -1, stringsAsFactors = FALSE, returnDataFrame = TRUE)
file | a character string specifying the name of the SBDF to import. |
keep |
a character vector of column names or a numeric vector of column numbers.
The columns specified are imported from the data file.
You can provide either keep or drop, but not both.
The variable names to keep also can be placed in a file and separated by spaces, commas, or newlines. In this case, you can pass the name of the file to keep as a character string beginning with the character "@". For example, keep="@keeplist.txt". |
drop |
a character vector of column names or a numeric vector of column numbers.
The columns specified are NOT imported from the data file.
You can provide either keep or drop, but not both.
The variable names to drop also can be placed in a file and separated by spaces, commas, or newlines. In this case, you can pass the name of the file to drop as a character string beginning with the character "@". For example, drop="@droplist.txt". |
startRow | an integer specifying the first row to be imported from the data file. If you specify a value less than 1, it defaults to the first row in the file. |
endRow | an integer specifying the final row to be imported from the data file. If you specify a value less than 1 or less than startRow, it defaults to the last row in the file. |
rowNamesCol | an integer denoting the column that should be used for row names. The specified column is dropped from the resulting data frame. |
stringsAsFactors | a logical value. If stringsAsFactors=TRUE, strings are converted to factors when imported. The default is FALSE, which imports strings as characters. |
returnDataFrame | a logical value, if FALSE, the data is imported as a list and not converted to a data.frame. This can be useful if some columns in your data are binary, which can result in S raw columns with lengths different from the other columns, so no column replication is done. The default is TRUE, which imports the data as a data.frame. |
SBDF data type | R data type | |
Boolean | logical | |
Integer (32 bit) | numeric | |
Currency* | numeric | |
Long (64 bit) | numeric | |
Float | numeric | |
Real | numeric | |
Decimal | numeric | |
String | character | |
Text | character | |
DateTime | POSIXct object with time zone UTC | |
Date | POSIXct object with time zone UTC | |
Time | POSIXct object with time zone UTC, specifying a time on the R epoch day 1/1/1970 | |
TimeSpan | difftime object with units secs | |
Binary | raw | |
# Import the sample data file, pima.sbdf pimaFile <- system.file("sample/pima.sbdf", package="SpotfireData") pima <- importDataFromSBDF(pimaFile)