Plotly in R is a package specifically designed to create highly-interactive and publication-quality charts. The chart can be created by using plot_ly function of the package and there are three main arguments of plot_ly defined as x, y, and type, where x refers to the X-axis, y refers to the Y-axis and type refers to the chart type but the axes values are stored in a data frame or itself a shared.
Loading plotly package:
Consider the below data frame:
> x<-c("United States of America","United Kingdom","Republic of China") > y<-c(501,510,505) > df<-data.frame(x,y) > df
x y 1 United States of America 501 2 United Kingdom 510 3 Republic of China 505
Creating the bar plot for x:
Warning message: `arrange_()` is deprecated as of dplyr 0.7.0. Please use `arrange()` instead. See vignette('programming') for more help This warning is displayed once every 8 hours. Call `lifecycle::last_warnings()` to see where this warning was generated.
Here it is showing a warning but it is not related to our chart hence there is no problem in ignoring it.