Joao Pedro
Joao Pedro

Reputation: 1

Error in identify(x, y, labels = name, plot = TRUE)

I trying to use the function identify() on R, but it's not working. Do you know if there is any package that I'm missing?

It doesn't work not even for a simple code:

x = 1:10
y = x^2

name = letters[1:10]    
plot(x, y)
identify(x, y, labels = name, plot=TRUE, n = 2)

Upvotes: 0

Views: 213

Answers (1)

TarJae
TarJae

Reputation: 79184

This way it works: it is the same code: With n=2 you have to click on two points:

x = 1:10 
y = x^2

name = letters[1:10]
plot(x, y) 
identify(x, y, labels = name, plot=TRUE, n = 2)

enter image description here

Upvotes: 1

Related Questions