Lines plot in R/Plotly


I am looking to create a lines plot in Plotly. With R, I can create such a plot using:

x <- c(1:5); y <- c(1, 2, 3, 2, 0.5) # create some data
plot(x,y, type=“n”)
lines(x,y, type =“h”)

and it shows up as:

I would like to add Plotly’s interactivity to this plot. Just wondering if there is a way to achieve that. I’ll appreciate your input.

Thank you,