str(CO2) # Structure still identifies 4 levels of the factor unique(CO2$Treatment) # But, unique says that only two are used CO2<-droplevels(CO2) # This command drops the unused levels from all factors in the data frame str(CO2) # Fixed!