Skip to content

Commit

Permalink
Fix levels of factor in austen_books()
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Oct 23, 2016
1 parent 738288e commit 6bd90d0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/austen_books.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ austen_books <- function(){
)
ret <- data.frame(text = unlist(books, use.names = FALSE), stringsAsFactors = FALSE)
ret$book <- factor(rep(names(books), sapply(books, length)))
levels(ret$book) <- unique(ret$book)
structure(ret, class = c("tbl_df", "tbl", "data.frame"))
}

0 comments on commit 6bd90d0

Please sign in to comment.