conditionPlot(mtcars, c("wt","hp"), c("wt"=3, "hp"=200), pointColor="am")
conditionPlot(mtcars, c("wt","hp"), mtcars[1,], pointColor="am")
#Calculate similarity using wt, hp observations from first case
sim <- similarityweight(mtcars[1, c("wt","hp")], mtcars[, c("wt","hp")], threshold=1)
# Marks points with black border with positive sim values. These are points within 1 (threshold) sd
#of pink cross.
conditionPlot(mtcars, c("wt","hp"), mtcars[1,], pointColor="am", sim=sim)
sim <- similarityweight(mtcars[1, ], mtcars, threshold=2)
conditionPlot(mtcars, names(mtcars), mtcars[1,], sim=sim)
Run the code above in your browser using DataLab