handling of dimension-attribute in density (PR#406)

polzehl@wias-berlin.de polzehl@wias-berlin.de
Thu, 27 Jan 2000 17:12:36 +0100 (MET)


Full_Name: Joerg Polzehl
Version: 0.90.1
OS: Digital UNIX V4.0F
Submission from: (NULL) (192.124.249.126)


The dimension attribute in function density is not handled correctly
(or at least differently from S) :

z_rnorm(1000)
dim(z)_c(10,10,10)
plot(density(z),type="l")

# no problem

plot(density(z[1,,]),type="l")

# Error in if (!(lo <- min(hi, IQR(x)/1.34))) (lo <- hi)
# || (lo <- abs(x[1])) ||  : missing value where logical
# needed
# In addition: Warning message: 
# NaNs produced in: sqrt(var(x, na.rm = na.rm)) 

######## x probably is still a matrix in the call of var()  ########

plot(density(as.vector(z[1,,])),type="l")

# again no problem


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._