verwenden, würde Ich mag ein 3D-Oberflächendiagramm zeichnen, wie auf der Abbildung:Wie das `group_by` Argument in der plot_ly Funktion in R
Mein Versuch, mit dem plotly
Paket ist unten:
library(plotly)
packageVersion("plotly")
# [1] ‘4.5.2’
# random data
a <- 0; s <- c(1:16)
x <- seq(a-3*max(s), a+3*max(s), len=10)
f <- sapply(s, function(ss) dnorm(x, a, ss))
df0=data.frame(x=rep(x,length(s)),
y=rep(s,each=length(x)),
z=f,
col=rep(seq(1,31,2),each=length(x)))
df0 %>% group_by(y) %>%
plot_ly(x = ~x, y = ~y, z = ~f, type = 'scatter3d', mode = 'lines',
line = list(width = 6,color = ~col,colorscale = 'Viridis'))
ich habe die Fehlermeldung:
Error in function_list[[i]](value) : could not find function "group_by"
Das group
Argument ist veraltet und ich hatte keinen Erfolg mit group_by
.
Frage. Wie umschreiben Sie das group_by
Argument?
Fehler 'in eval (expr, envir, enclos): Objekt' z 'nicht gefunden'. – CCurtis
Danke, ich habe den Code in der Zeile 'plot_ly' (x = ~ x, y = ~ y, z = ~ f, typ = 'scatter3d', mode = 'Linien', ' – Nick