[R] reshape2's dcast() Adds NAs to Data Frame

Rich Shepard rshepard at appl-ecosys.com
Thu Aug 9 04:48:11 CEST 2012


On Wed, 8 Aug 2012, Jeff Newmiller wrote:

> The explanation is that this is normal and consistent with behavior of
> factors in general. If you don't want that, it is common to work with
> character data instead of factors, only converting to factor when needed.
> In most cases I invoke read.table with the as.is=TRUE argument and delay
> converting to factors until I need them. Other people convert from factor
> to character and back to factor to get rid of unwanted factor levels on an
> as-needed basis.

Jeff,

   First thing tomorrow I will research the difference between characters and
data; I assumed they were the same.

Thanks,

Rich



More information about the R-help mailing list