Ich möchte ein Facettenplot mit 4 Punktdiagrammen erstellen, jedoch gibt mein Code unten den Fehler "Error in p + facet_grid(party ~ state) : non-numeric argument to binary operator"
zurück. Irgendwelche Ideen warum?Fehler "nicht numerisches Argument zu binärem Operator" mit plotly facet_grid
# plotly minimum reproducible example
library(plotly)
# create dummy data set
state <- c("MA", "MA", "CA", "CA")
party <- c("Republican", "Democrat", "Republican", "Democrat")
age <- c(45,32,28,76)
FICO <- c(675, 789, 425, 690)
df <- data.frame(state, party, age , FICO)
# Create 4 scatter plots
p <- plot_ly(data = df, x = ~age, y = ~FICO)
p <- p + facet_grid(party ~ state)
print(p)
Vielen Dank!