Scatterplot and data values do not add up

I am using a Data 261 obs. of 10 variables.
Where by, Gender : int ( which contain value 1 or 0)
and Cert: int( which contain value 1 or 0)

plot(Data$Gender, Data$Cert)
> identify(x=Data$Gender, y=Data$Cert)
[1]  1  4 31 32

The total value on the scatterplot 1 + 4 + 31 + 32 do not equal to 261 values./
i hope to get some advice on this thank you.

The identify() function does not return the number of points near the pointer; it returns the index within the plotting vectors of the selected point. I do not know how it chooses a point if there is exact over plotting, as in your case.

For example, if you plot the following data

DF <- data.frame(Cert=c(3,4,5,6,7,8,9),Gender=c(2,3,4,5,6,7,8))

call identify() and click on the point at (5,4), identify() will return 3 because the chosen point is the third element in each of the vectors DF$Cert and DF$Gender.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.