groupVec
Class - Data AccessAccesses the columns of a groupVec
object.
groupVecColumn(object, col.name)
returns the data in the given columns.
If only one column is supplied, the result is the column
If more than one name is supplied, the result is a list of columns.
the object to access.
the name of columns to access.
The function finds the given column by comparing col.name
to the names
slot of object
, and then extracts the corresponding
vectors from the list in the columns
slot of object
.
You can use this function on the left side of an assignment to replace the given columns with new values.
If you replace one column, supply the value as a vector.
If you replace multiple columns, supply the values in a list.
The new data is coerced to the columns
class using
as
before the replacement, and the column lengths are checked.
groupVecData
, groupVecNames
, groupVecClasses
, groupVec
class.
obj <- new("groupVec")
groupVecNames(obj) <- "colname1"
groupVecColumn(obj, "colname1") <- c(1, 2, 3)
groupVecColumn(obj, "colname1")
Run the code above in your browser using DataLab