plotly (version 2.0.2)

ggplotly: Create plotly graphs using ggplot2 syntax

Description

See up-to-date documentation and examples at https://plot.ly/ggplot2

Usage

ggplotly(p = ggplot2::last_plot(), filename, fileopt, world_readable = TRUE)

Arguments

p
a ggplot object.
filename
character string describing the name of the plot in your plotly account. Use / to specify directories. If a directory path does not exist it will be created. If this argument is not specified and the title of the plot exists, that will be used for the fi
fileopt
character string describing whether to create a "new" plotly, "overwrite" an existing plotly, "append" data to existing plotly, or "extend" it.
world_readable
logical. If TRUE, the graph is viewable by anyone who has the link and in the owner's plotly account. If FALSE, graph is only viewable in the owner's plotly account.

See Also

signup, plot_ly

Examples

Run this code
# simple example
ggiris <- qplot(Petal.Width, Sepal.Length, data = iris, color = Species)
ggplotly(ggiris)

# maps!!
data(canada.cities, package = "maps")
viz <- ggplot(canada.cities, aes(long, lat)) +
  borders(regions = "canada", name = "borders") +
  coord_equal() +
  geom_point(aes(text = name, size = pop), colour = "red",
               alpha = 1/2, name = "cities")
 ggplotly(viz)

Run the code above in your browser using DataLab