hi, I am trying to calculate distance matrices for binary data frame. I am using dist.binary in 'ade4' package. This is the code i run and get error message as 'missing value where True/False needed: clss <- as.data.frame(cls) dist.binary(clss, method = 1, diag = FALSE, upper = FALSE) Also, if i convert the factors into numeric(i.e,1&2 in the place of 0&1 for present/absent data), i get the distance matrices with 0's as elements. This is the code i run and get the matrix with all the elements as zeros: d <- as.data.frame(lapply(cls,as.numeric)); dist.binary(d, method = 1, diag = FALSE, upper = FALSE) Can anybody help me to rectify the error? Thanks in advance, Kind regards, Ms.Karunambigai M PhD Scholar Dept. of Biostatistics NIMHANS Bangalore India The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. [[alternative HTML version deleted]]
karuna m wrote:> > hi, > I am trying to calculate distance matrices for binary data frame. I am > using dist.binary in 'ade4' package. This is the code i run and get error > message as 'missing value where True/False?needed: > clss <- as.data.frame(cls) > dist.binary(clss, method = 1, diag = FALSE, upper = FALSE) > Also, if i convert the factors into numeric(i.e,1&2 in the place of 0&1 > for present/absent data), i get the distance matrices with 0's as > elements. This is the code i run and get the matrix with all the elements > as zeros: > d <- as.data.frame(lapply(cls,as.numeric)); > dist.binary(d, method = 1, diag = FALSE, upper = FALSE) > Can anybody help me to rectify the error? > Thanks in advance, > ? > Kind regards, > > > Ms.Karunambigai M > PhD Scholar > Dept. of Biostatistics > NIMHANS > Bangalore > India > > > The INTERNET now has a personality. YOURS! See your Yahoo! Homepage. > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > >-- View this message in context: old.nabble.com/binary-data-tp26332493p26508277.html Sent from the R help mailing list archive at Nabble.com.