Insert a blank column in dataframe

You can add your blank column, re-order, and sort using the code below:

df$blankVar <- NA #blank column 
df[c("Card", "blankVar", "Model_Avg_Error", "Forecast", "Delta")] #re-ordering columns by name
df[order(df$Model_Avg_Error),] #sorting by Model_Avg_Error

Leave a Comment