TabularTextFile | R Documentation |
Package: R.filesets
Class TabularTextFile
Object
~~|
~~+--
FullNameInterface
~~~~~~~|
~~~~~~~+--
GenericDataFile
~~~~~~~~~~~~|
~~~~~~~~~~~~+--
ColumnNamesInterface
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--
GenericTabularFile
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--
TabularTextFile
Directly known subclasses:
public abstract static class TabularTextFile
extends GenericTabularFile
A TabularTextFile is an object referring to a tabular text file on a file system containing data in a tabular format. Methods for reading all or a subset of the tabular data exist.
TabularTextFile(..., sep=c("\t", ","), quote="\"", fill=FALSE, skip=0L, columnNames=NA,
commentChar="#", .verify=TRUE, verbose=FALSE)
... |
Arguments passed to |
sep |
A |
quote |
A |
fill |
As in |
skip |
As in |
columnNames |
A |
commentChar |
A single |
.verify , verbose |
(Internal only) If |
Methods:
getHeader | - | |
nbrOfLines | - | |
nbrOfRows | - | |
readDataFrame | - | |
readLines | - | |
Methods inherited from GenericTabularFile:
[, as.character, dim, extractMatrix, head, nbrOfColumns, nbrOfRows, readColumns, readDataFrame, tail, writeColumnsToFiles
Methods inherited from ColumnNamesInterface:
appendColumnNamesTranslator, appendColumnNamesTranslatorByNULL, appendColumnNamesTranslatorBycharacter, appendColumnNamesTranslatorByfunction, appendColumnNamesTranslatorBylist, clearColumnNamesTranslator, clearListOfColumnNamesTranslators, getColumnNames, getColumnNamesTranslator, getDefaultColumnNames, getListOfColumnNamesTranslators, nbrOfColumns, setColumnNames, setColumnNamesTranslator, setListOfColumnNamesTranslators, updateColumnNames
Methods inherited from GenericDataFile:
as.character, clone, compareChecksum, copyTo, equals, fromFile, getAttribute, getAttributes, getChecksum, getChecksumFile, getCreatedOn, getDefaultFullName, getExtension, getExtensionPattern, getFileSize, getFileType, getFilename, getFilenameExtension, getLastAccessedOn, getLastModifiedOn, getOutputExtension, getPath, getPathname, gunzip, gzip, hasBeenModified, is.na, isFile, isGzipped, linkTo, readChecksum, renameTo, renameToUpperCaseExt, setAttribute, setAttributes, setAttributesBy, setAttributesByTags, setExtensionPattern, testAttributes, validate, validateChecksum, writeChecksum
Methods inherited from FullNameInterface:
appendFullNameTranslator, appendFullNameTranslatorByNULL, appendFullNameTranslatorByTabularTextFile, appendFullNameTranslatorByTabularTextFileSet, appendFullNameTranslatorBycharacter, appendFullNameTranslatorBydata.frame, appendFullNameTranslatorByfunction, appendFullNameTranslatorBylist, clearFullNameTranslator, clearListOfFullNameTranslators, getDefaultFullName, getFullName, getFullNameTranslator, getListOfFullNameTranslators, getName, getTags, hasTag, hasTags, resetFullName, setFullName, setFullNameTranslator, setListOfFullNameTranslators, setName, setTags, updateFullName
Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save
Henrik Bengtsson
An object of this class is typically part of an TabularTextFileSet
.
path <- system.file("exData/dataSetA,original", package="R.filesets")
db <- TabularTextFile("fileA,20100112.dat", path=path)
print(db)
# Read all data
data <- readDataFrame(db)
print(data)
# Read columns 'x', 'y', and 'char'
data <- readDataFrame(db, colClasses=c("(x|y)"="integer", "char"="character"))
print(data)
# Translate column names on the fly
db <- setColumnNamesTranslator(db, function(names, ...) toupper(names))
data <- readDataFrame(db, colClasses=c("(X|Y)"="integer", "CHAR"="character"))
print(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.