R is a programming language possesses an extensive catalog of statistical and graphical methods. It includes machine learning algorithm, linear regression, time series, statistical inference to name a few. Most of the R libraries are written in R,but many large companies also use R programming language, including Uber, Google, Airbnb, Facebook and so on

AD1

Email subscriptions

Enter your email address:

Delivered by FeedBurner

Showing posts with label There are a few ways to create a map in plotly. Show all posts
Showing posts with label There are a few ways to create a map in plotly. Show all posts

Saturday, January 5, 2019

There are a few ways to create a map in plotly-R

 ways to create a map in plotly-R

library(plotly)
map_data("county") %>%
+     group_by(group) %>%
+     plot_ly(x = ~long, y = ~lat) %>%
+     add_polygons() %>%
+   
+ layout(
+     xaxis = list(title = "", showgrid = FALSE, showticklabels = FALSE),
+     yaxis = list(title = "", showgrid = FALSE, showticklabels = FALSE)
+ )
www.r-languagestatistics.co
map_data("world", "canada") %>%
+     group_by(group) %>%
+     plot_ly(x = ~long, y = ~lat, alpha = 0.2) %>%
+     add_polygons(hoverinfo = "none", color = I("black")) %>%
+     add_markers(text = ~paste(name, "<br />", pop), hoverinfo = "text", 
+                 color = I("red"), data = maps::canada.cities) %>%
+     layout(showlegend = FALSE)
www.r-languagestatistics.co


a