Skip to content

Commit

Permalink
Merge pull request #101 from jschadewald/master
Browse files Browse the repository at this point in the history
Example now preserves integrity of the data in when
  • Loading branch information
topepo committed Jan 28, 2015
2 parents 3d6d999 + 985bf35 commit f2da367
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/caret/man/dummyVars.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,11 @@ when <- data.frame(time = c("afternoon", "night", "afternoon",
"Wed", "Wed", "Fri",
"Sat", "Sat", "Fri"))

levels(when$time) <- c("morning", "afternoon", "night")
levels(when$day) <- c("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
levels(when$time) <- list(morning="morning",
afternoon="afternoon",
night="night")
levels(when$day) <- list(Mon="Mon", Tue="Tue", Wed="Wed", Thu="Thu",
Fri="Fri", Sat="Sat", Sun="Sun")

## Default behavior:
model.matrix(~day, when)
Expand Down

0 comments on commit f2da367

Please sign in to comment.