Skip to content
Prev 101112 / 398500 Next

how to convert all columns of a data frame into factors

Alternatively:

x[] <- lapply(x, factor)

Recall that a data frame is a list, so lapply() is a natural choice.

Andy 

From: Gabor Grothendieck
------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}