dfm class, depending on whether the object can be
represented by a sparse matrix, in which case it is a dfmSparse
class object, or if dense, then a dfmDense object. See Details.## S3 method for class 'dfmDense':
t(x)## S3 method for class 'dfmSparse':
t(x)
## S3 method for class 'dfmSparse':
colSums(x, na.rm = FALSE, dims = 1L, ...)
## S3 method for class 'dfmSparse':
rowSums(x, na.rm = FALSE, dims = 1L, ...)
## S3 method for class 'dfmSparse':
colMeans(x, na.rm = FALSE, dims = 1L, ...)
## S3 method for class 'dfmSparse':
rowMeans(x, na.rm = FALSE, dims = 1L, ...)
## S3 method for class 'dfmDense,index,index,missing':
[(x, i = NULL, j = NULL, ...,
drop = FALSE)
## S3 method for class 'dfmDense,index,index,logical':
[(x, i = NULL, j = NULL, ...,
drop = FALSE)
## S3 method for class 'dfmDense,index,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,logical,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,index,missing,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,missing,index,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,missing,index,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,missing,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmDense,missing,missing,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,index,index,missing':
[(x, i = NULL, j = NULL, ...,
drop = FALSE)
## S3 method for class 'dfmSparse,index,index,logical':
[(x, i = NULL, j = NULL, ...,
drop = FALSE)
## S3 method for class 'dfmSparse,logical,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,index,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,index,missing,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,missing,index,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,missing,index,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,missing,missing,missing':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,missing,missing,logical':
[(x, i, j, ..., drop = FALSE)
## S3 method for class 'dfmSparse,numeric':
+(e1, e2)
## S3 method for class 'numeric,dfmSparse':
+(e1, e2)
## S3 method for class 'dfmDense,numeric':
+(e1, e2)
## S3 method for class 'numeric,dfmDense':
+(e1, e2)
## S3 method for class 'dfm':
as.matrix(x)
TRUE, omit missing values (including NaN) from
the calculationsFALSEdfm class is a virtual class that will contain one of two
subclasses for containing the cell counts of document-feature matrixes:
dfmSparse or dfmDense.The dfmSparse class is a sparse matrix version of
dfm-class, inheriting dgCMatrix-class from the
The dfmDense class is a sparse matrix version of dfm-class,
inheriting dgeMatrix-class from the dfmSparse class, because each cell is recorded as a numeric (double) type
requiring 8 bytes of storage.
# coercion to matrix
dfmSparse <- dfm(inaugTexts, verbose = FALSE)
str(as.matrix(dfmSparse))Run the code above in your browser using DataLab