-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
In plotcc.R file in the folder R/chapter5/, you have used:
contour(gridvalsX,gridvalsY,matrix(Probs,nrow=dim(Xv)[[1]],ncol=dim(Xv)[[2]],byrow=TRUE),add=TRUE)
However, it should be:
contour(gridvalsX,gridvalsY,matrix(Probs,nrow=dim(Xv)[[2]],ncol=dim(Xv)[[1]],byrow=TRUE),add=TRUE)
That is because in the meshgrid output, the rows of the output array X are copies of the vector gridvalsX, so the length of gridvalsX is equal to the number of columns in mesh$X which is dim(Xv)[[2]], and length of gridvalsY is equal to the number of rows in mesh$X which is dim(Xv)[[1]]. The code runs since both gridvalsX and gridvalsY have the same dimension, however, if you make them different, you get an error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels