z[.numdfr: Extract or Replace Parts of an Object

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Subset numdfr object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## S3 method for class 'numdfr'
x[i, j, returnAsMatrix = drop, drop = FALSE]
## S3 replacement method for class 'numdfr'
x[i, j] <- value
## S3 method for class 'numdfr'
x[[..., exact=TRUE]]
## S3 method for class 'numdfr'
x$name
## S3 replacement method for class 'numdfr'
x[[i]]<-value
## S3 replacement method for class 'numdfr'
x$name<-value

Arguments

x

numdfr object

i, j

elements to extract or replace. Numeric or character or, empty. Numeric values are coerced to integer as if by as.integer. For replacement, a logical matrix is allowed.

returnAsMatrix

if TRUE, the result is not a numdfr object, but a regular matrix. Default is FALSE, unless drop is TRUE.

drop

if TRUE, the dimsensions of size 1 are removed from the return value.

value

new values(s)

...

column names. For now, only one column is allowed.

exact

if TRUE (the default) the column name is exactly matched, otherwise, partial matching is applied.

name

Single column name

Details

Mostly designed to work similarly to [.data.frame, but needed to provide an extra parameter returnAsMatrix.

There are still some cases unsupported in the assignment operators. The value is converted as best possible to the format of the column if it was an existing column.

Value

Depending on the logical parameters, a numdfr, a matrix (2-dimensional) or a vector.

Author(s)

Nick Sabbe

See Also

NumDfr, [, [.data.frame

Examples

1
2
3
4
5
6
7
8
9
iris.nd<-numdfr(iris)
iris.nd[1,1]
iris.nd[1,1]<-8
iris.nd[1,1]
iris.nd[,"Sepal.Length"]<-iris.nd[,"Sepal.Length", drop=TRUE]*2

iris.nd[["anewcol"]]<-rep(1, nrow(iris.nd))
iris.nd[[15]]<-sample(letters[1:3], nrow(iris.nd), replace=TRUE)
iris.nd[[14]]<-c(19,26)

NumDfr documentation built on May 2, 2019, 5:50 p.m.