Subscripting data tables is very handy but is it possible to use the "by" function in this (for example by( :age )) to pull all the names of people who have the same age into the column?
Here is an example:
I'd like to take all the names where the age is the same and concatenate them in a column.
One of the common next steps is then summarizing other columns by those concatenated names.
I've dug through and tried multiple approaches and I think I'm just missing something simple, but what I'm hoping is that there is a very straightforward way to do this using either subscription or something like
dt:name << get values(by(age)) and then either put that in a column or use it in a script.
I tried this as a formula column:
dt[Index( :first_row, :last_row ), {:name}]
And each subexpression provided the correct result to match your example
// fetch a list if character columns are involved.
// notice the matrix is reversing the order
dt[ 4::2, "name"]; // {"JACLYN", "JANE", "LOUISE"}
but I'm not able to get the actual list of names {"JACLYN", "JANE", "LOUISE"} to return in the column.
Thank you for any help,
Aron