title: How to continue to use factor where one level is missing (has been removed)?
body: <p>I'm working with a set of Fitbit data that I've downloaded and it has a list of weekdays that I'm trying to order properly. Now, the current data set has no "Fridays", but I want the factors to include it regardless. </p>
  
  <p>How can I continue to factor the Weekdays, as 1-7 even if there are only 6 weekdays in the data set?</p>
  
  <pre><code>file&lt;-choose.files()
     slp&lt;-data.frame(read.csv(file))
  
     wkdaylevels&lt;-c("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
  
      slp$FellAsleepAt&lt;-strptime(slp$FellAsleepAt, format="%B %e, %Y at %I:%M%p")
      slp$AwokeAt&lt;-strptime(slp$AwokeAt,format="%B %e, %Y at %I:%M%p")
      slp$TotalTimeSlept&lt;-gsub("h ",":",slp$TotalTimeSlept)
      slp$TotalTimeSlept&lt;-gsub("m","",slp$TotalTimeSlept)
      slp$TimeAsleep&lt;-as.numeric(difftime(slp$AwokeAt,slp$FellAsleepAt))
      slp$Date&lt;-as.Date(slp$FellAsleepAt, format="%M/%D/%Y")
      slp$DayofWeek&lt;-as.factor(weekdays(slp$Date),levels=wkdaylevels)
  
  
  
      ggplot(slp,aes(x=DayofWeek,y=TimeAsleep))+
          geom_point()
  </code></pre>
  
  <p>Data here: <a href="https://docs.google.com/spreadsheets/d/1Vdgmtwx0vNKDKEZFMEGAWQ58H66ia-xjI0evR7idfkc/edit?usp=sharing" rel="nofollow">https://docs.google.com/spreadsheets/d/1Vdgmtwx0vNKDKEZFMEGAWQ58H66ia-xjI0evR7idfkc/edit?usp=sharing</a></p>