GenericDataFileSet | R Documentation |
Package: R.filesets
Class GenericDataFileSet
Object
~~|
~~+--
FullNameInterface
~~~~~~~|
~~~~~~~+--
GenericDataFileSet
Directly known subclasses:
ChecksumFileSet, GenericTabularFileSet, RDataFileSet, RdsFileSet, TabularTextFileSet
public static class GenericDataFileSet
extends FullNameInterface
A GenericDataFileSet object represents a set of GenericDataFile
s.
GenericDataFileSet(files=NULL, tags="*", depth=NULL, ...,
.onUnknownArgs=c("error", "warning", "ignore"))
files |
A |
tags |
A |
depth |
An non-negative |
... |
Not used. |
.onUnknownArgs |
A |
Methods:
anyDuplicated | - | |
anyNA | - | |
append | - | |
appendFiles | - | |
as.list | - | |
byName | - | |
byPath | - | |
duplicated | - | |
equals | - | |
extract | - | |
getChecksum | - | |
getChecksumFileSet | - | |
getDefaultFullName | - | |
getFile | - | |
getFileClass | - | |
getFileSize | - | |
getFullNames | - | |
getNames | - | |
getOneFile | - | |
getPath | - | |
getPathnames | - | |
gunzip | - | |
gzip | - | |
hasFile | - | |
indexOf | - | |
is.na | - | |
sortBy | - | |
unique | - | |
validate | - | |
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
# Setup a file set
path <- system.file(package="R.filesets")
ds <- GenericDataFileSet$byPath(path)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Data set
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cat("Path of data set:\n")
print(getPath(ds))
cat("Fullname of data set:\n")
print(getFullName(ds))
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Data files
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cat("Pathnames:\n")
print(getPathnames(ds))
cat("Filenames:\n")
print(sapply(ds, getFilename))
cat("Extensions:\n")
print(sapply(ds, getExtension))
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Subsetting
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
n <- length(ds)
ds2 <- extract(ds, 1:n)
print(ds2)
ds3 <- extract(ds, n:1)
print(ds3)
stopifnot(identical(rev(getPathnames(ds3)), getPathnames(ds2)))
idxs <- c(1,2,NA,n,NA)
ds4 <- extract(ds, idxs, onMissing="NA")
print(ds4)
print(getFullNames(ds4))
print(getFiles(ds4))
stopifnot(identical(is.na(idxs), unname(is.na(getPathnames(ds4)))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.