Why daisy() in cluster library failed to exclude NA when computing dissimilarity
1
0
Entering edit mode
@gundala-viswanath-2872
Last seen 9.6 years ago
Hi, According to daisy function from cluster documentation, it can compute dissimilarity when NA (missing) value(s) is present. http://stat.ethz.ch/R-manual/R-devel/library/cluster/html/daisy.html But why when I tried this code library(cluster) x <- c(1.115,NA,NA,0.971,NA) y <- c(NA,1.006,NA,NA,0.645) df <- as.data.frame(rbind(x,y)) daisy(df,metric="gower") It gave this message: Dissimilarities : x y NA Metric : mixed ; Types = I, I, I, I, I Number of objects : 2 Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf I welcome other alternative than gower. I expect the dissimilarity output gives a non-NA value e.g. 0. What's the right way to do it? G.V.
• 1.2k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 8 hours ago
United States
Hi Gundala, This question isn't about a Bioconductor package, so should be asked on R-help instead. Best, Jim On Sunday, December 08, 2013 2:11:12 AM, Gundala Viswanath wrote: > Hi, > > > According to daisy function from cluster documentation, it can compute > dissimilarity when NA (missing) value(s) is present. > > http://stat.ethz.ch/R-manual/R-devel/library/cluster/html/daisy.html > > But why when I tried this code > > library(cluster) > x <- c(1.115,NA,NA,0.971,NA) > y <- c(NA,1.006,NA,NA,0.645) > df <- as.data.frame(rbind(x,y)) > daisy(df,metric="gower") > > It gave this message: > > Dissimilarities : > x > y NA > > Metric : mixed ; Types = I, I, I, I, I > Number of objects : 2 > Warning messages: > 1: In min(x) : no non-missing arguments to min; returning Inf > 2: In max(x) : no non-missing arguments to max; returning -Inf > > I welcome other alternative than gower. > > I expect the dissimilarity output gives a non-NA value e.g. 0. What's > the right way to do it? > > G.V. > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
ADD COMMENT

Login before adding your answer.

Traffic: 587 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6