how to do iplot in r

If you want to create interactive plots using R, you can use the iplot function from the plotly package. Here's some example code that uses ggplot2 to create a scatter plot, then converts the plot to an interactive plot using iplot:

main.r
library(ggplot2)
library(plotly)

# Create a scatter plot
p <- ggplot(mpg, aes(x = displ, y = hwy)) +
  geom_point()

# Convert the plot to an interactive plot
iplot(p)
169 chars
10 lines

This will open an interactive version of the plot in your default web browser, allowing you to explore the data using zoom, pan, and hover tools.

gistlibby LogSnag