Skip to content

how to melt variable to one variable

1 message · arun

#
Hi,
I am not getting any errors.

data_chir <- read.table(text="N1_re N2_re N3_re
yes no no
no yes no
na yes yes
no na no",sep="",header=TRUE,stringsAsFactors=FALSE,na.strings="na")
library(reshape2)
melt(data_chir, measure.vars=c("N1_re", "N2_re"), var="zpd")
? N3_re?? zpd value
1??? no N1_re?? yes
2??? no N1_re??? no
3?? yes N1_re? <NA>
4??? no N1_re??? no
5??? no N2_re??? no
6??? no N2_re?? yes
7?? yes N2_re?? yes
8??? no N2_re? <NA>
A.K.
On Saturday, November 23, 2013 5:02 PM, maggy yan <kiotoqq at gmail.com> wrote:
sorry, I forgot that.. the variables look like this:
N1_re N2_re N3_re
yes no no
no yes no
na ye yes
no na no



2013/11/23 arun <smartpink111 at yahoo.com>

Hi,