plot_ly(profiles, x = ~age, y = ~income, text=~education, color = ~location)
## No trace type specified:
## Based on info supplied, a 'scatter' trace seems appropriate.
## Read more about this trace type -> https://plot.ly/r/reference/#scatter
## No scatter mode specifed:
## Setting the mode to markers
## Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
## Warning: Ignoring 48442 observations
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
plot_ly(profiles, x = ~sign, color = ~income) %>%
add_histogram()
## Warning: Ignoring 11056 observations
## Warning in min(x, na.rm = na.rm): no non-missing arguments to min;
## returning Inf
## Warning in max(x, na.rm = na.rm): no non-missing arguments to max;
## returning -Inf
library(GGally)
corr <- Batting %>%
select(G, AB, R, H, X2B, X3B, HR, BB)
corr.1 <- cor(corr[vapply(corr, is.numeric, logical(1))])
plot_ly(x= colnames(corr.1), y=rownames(corr.1),z=corr.1)%>%
add_heatmap()
data <- bechdel %>%
group_by(test) %>%
summarise(n.subject= n())
plot_ly(data, labels = ~test, values = ~n.subject, type = 'pie')
plot_ly(profiles, x = ~pets, y = ~income, z = ~height) %>%
add_markers(color = ~pets)
## Warning: Ignoring 51229 observations
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
head(bechdel)
## # A tibble: 6 x 15
## year imdb title test clean_test binary
## <int> <chr> <chr> <chr> <fctr> <chr>
## 1 2013 tt1711425 21 & Over notalk notalk FAIL
## 2 2012 tt1343727 Dredd 3D ok-disagree ok PASS
## 3 2013 tt2024544 12 Years a Slave notalk-disagree notalk FAIL
## 4 2013 tt1272878 2 Guns notalk notalk FAIL
## 5 2013 tt0453562 42 men men FAIL
## 6 2013 tt1335975 47 Ronin men men FAIL
## # ... with 9 more variables: budget <int>, domgross <dbl>, intgross <dbl>,
## # code <chr>, budget_2013 <int>, domgross_2013 <dbl>,
## # intgross_2013 <dbl>, period_code <int>, decade_code <int>
plot_ly(bechdel, x = ~budget, y = ~interaction(binary, test)) %>%
add_boxplot(color = ~test) %>%
layout(yaxis = list(title = "test"), margin = list(l = 100))
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
p <- plot_ly(bechdel, x = ~budget, y = ~domgross_2013, alpha = 0.5)
subplot(
add_markers(p, color = ~intgross_2013, showlegend = FALSE) %>%
colorbar(title = "Viridis"),
add_markers(p, color = ~factor(intgross_2013))
)
## Warning: Ignoring 18 observations
## Warning: Ignoring 18 observations
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors