The problem is as someone commented. The original code (I'm taking the class as well) did prescribe changing COPD$Diabetes from an integer to a factor for a previous test. The course assumes that you retain your same R program and coding session and are starting exactly where you left off in each subsequent activity.
Run COPD$Diabetes as a factor and then run the new script.