I have a table T
Date City Visitors----------------------1/1/2020 New York 101/2/2020 New York 20
I want to add a variable 'state' that looks like
Date City Visitors State ----------------------1/1/2020 New York 10 NY1/2/2020 New York 20 NY
I did
state=strings(height(T),1)
then
state(:) = 'NY'
then I create a table and merged. But is there a simpler way?
Best Answer