Re: [R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread John Kane via R-help
I am not really sure what the warning means but I think your underlying problem is that all your variables are factors. Did you intend the values in each variable to be character? data.frame':    3 obs. of  5 variables:  $ V1: Factor w/ 3 levels "Name1","Name2",..: 1 2 3  $ V2: Factor w/ 3

Re: [R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
Is this the solution? > d1<- as.data.frame(lapply(data,as.character),stringsAsFactors=FALSE) > str(d1) 'data.frame':3 obs. of 5 variables: $ V1: chr "Name1" "Name2" "Name3" $ V2: chr "nam1" "name_12" "name-1" $ V3: chr "nam2" "nam_34" "name-2" $ V4: chr "nam3" "nam_56" "" $ V5: chr

[R] Warning from reshape2 when melting a data frame with uneven number of columns.

2017-06-04 Thread Ashim Kapoor
Here is a small reproducible example: data <- structure(list(V1 = structure(1:3, .Label = c("Name1", "Name2", "Name3"), class = "factor"), V2 = structure(c(1L, 3L, 2L), .Label = c("nam1", "name-1", "name_12"), class = "factor"), V3 = structure(1:3, .Label = c("nam2", "nam_34", "name-2"), class =