Can someone please help me understand why the following code runs, produces a graph, but with warning messages:
library(plotly)
library(dplyr)
X <- seq(0,100,1)
Y <- seq(0,100,1)
DF <- expand.grid(X,Y)
DF$Z <- sin(DF$Var1) + cos(DF$Var2)
Z <- matrix(DF$Z, nrow = 100)
plot_ly(y = ~Y, x = ~X, z=~Z) %>%
add_surface()
But the code below does runs with no warning messages, but produces an empty graph:
X <- seq(0,100,1)
Y <- seq(0,100,1)
DF <- expand.grid(X,Y)
DF <- expand.grid(X,Y)
DF$Z <- sin(DF$Var1) + cos(DF$Var2)
Z <- matrix(DF$Z, nrow = 10201)
plot_ly(y = ~Y, x = ~X, z=~Z) %>%
add_surface()
Thanks