I'm trying to delete columns based on specific data in those columns. For example, if the column contains the value RA, TV, EW, or EH I want to delete it. I've worked with the code below and no errors appear in the log, but no columns are deleted either. Thanks for any help.
dt = current data table();
for(i = 1, i<=NCol(dt), i++,
if (Column(i)== "RA" , dt<< delete columns(column(i)),
if(Column(i) == "TV", dt << delete columns(column(i)),
if(Column(i) == "EW", dt<< delete columns(column(i)),
if(Column(i) == "EH", dt << delete columns(column(i))
)))));
I've also tried this
dt = current data table();
for(i = 1, i<=NCol(dt), i++,
for each row(if (Column(i)== "RA" , dt<< delete columns(column(i)),
if(Column(i) == "TV", dt << delete columns(column(i)),
if(Column(i) == "EW", dt<< delete columns(column(i)),
if(Column(i) == "High Dose", dt << delete columns(column(i))
)))));
);