View source: R/GenerateComment.R
GenerateComment | R Documentation |
For all rows concerned by the condition, the function add a string in the chosen column of a data.table. If there is already a value, the string is pasted after the "/" separator.
GenerateComment(Data, condition, comment, column = "Comment")
Data |
Dataset (data.table) |
condition |
Vector of logicals |
comment |
The string to add in the column (character) |
column |
Column name to fill (character) |
The input data.table with the filled column.
## Not run:
library(data.table)
dt <- data.table(A = c(2, 1, 3), B = c(6, 10, 6))
dt[A == 2,
"information" := paste0("A = 2")] # 1st comment
GenerateComment(dt, condition = dt[,B] == 6, comment = "B = 6", column = "information")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.