Export to GitHub

mifuns - issue #62

plotCovariates discloses a bug in package 'reshape'


Posted on Feb 15, 2011 by Happy Bear

When cat.cov specifies a numeric variable with values higher than the highest equivalent numeric in some other variable encoded as character, the numeric variable is not plotted.

Root problem is a bug in 'reshape':

x <- data.frame( name=c('Fred','Barney'), wife=c('Wilma','Betty'), age=c(45,39) )

the first of these converts both measure.var to character and stacks them; the second generates NA factor levels for 'age':

melt(x,measure.var=c('age','wife')) melt(x,measure.var=c('wife','age'))

Author of 'reshape' says the bug is fixed in 'reshape2'.

Comment #1

Posted on Apr 14, 2011 by Happy Bear

reshape2 v. 1.1 has a different problem that breaks MIfuns.

[.foo <- function (x, ..., drop = TRUE) { cl <- oldClass(x) class(x) <- NULL val <- NextMethod("[") class(val) <- cl val }

reshape2:::melt.data.frame(head(Theoph),id.var='Subject',measure.var=c('conc','Time'))

no problem

class(Theoph$Subject) <- 'foo' reshape2:::melt.data.frame(head(Theoph),id.var='Subject',measure.var=c('conc','Time'))

"Error in data.frame(ids, variable, value, stringsAsFactors = FALSE)

: arguments imply differing number of rows: 6, 12" reshape:::melt.data.frame(head(Theoph),id.var='Subject',measure.var=c('conc','Time'))

no problem

Status: Accepted

Labels:
Type-Defect Priority-Medium