addProperty {RMassBank} | R Documentation |
Adds a new column of a defined type to a data.frame
and initializes it to a value.
The advantage of doing this over adding it with $
or [,""]
is that the case
nrow(o) == 0
is adequately handled and doesn't raise an error.
addProperty(o, name, type, value = NA) ## S4 method for signature 'data.frame,character,character' addProperty(o, name, type, value = NA)
o |
|
name |
Name of the new column |
type |
Data type of the new column |
value |
Initial value of the new column ( |
Expanded data frame.
o = data.frame,name = character,type = character
: Add a new column to a data.frame
stravsmi