Description Usage Arguments Details Value See Also Examples
Modify or add columns to a dataset.
1 2 |
_data |
a dataset object. |
... |
expressions used to modify or update the dataset. |
The transform
function converts its first argument to a dataset,
then evaluates the quoted remaining arguments using scope
. Named
arguments replace the corresponding columns in x
, or get appended
if the names don't already exist; unnamed arguments get names taken from
their quoted values.
The modified dataset with the new columns.
1 2 3 4 | transform.dataset(mtcars, cyl = 2 * cyl) # modify an existing column
x <- as.dataset(iris)
transform(x, area = Sepal.Length * Sepal.Width) # add a new column
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.