LoslegenKostenlos loslegen

Customizing color

Just like with a single scatterplot, it can be useful to add color to represent an additional variable in a scatterplot matrix. In this exercise, you will add color to represent whether the game was produced by Nintendo or not.

In the code provided, an indicator (i.e. dummy) variable(nintendo) has been created to indicate whether a game was published by Nintendo or some other publisher.

Note that plotly has already been loaded for you.

Diese Übung ist Teil des Kurses

Interactive Data Visualization with plotly in R

Kurs anzeigen

Anleitung zur Übung

  • Recreate the SPLOM of NA_Sales, EU_Sales, and JP_Sales (in that order). Remember to label the panels N. America, Europe, and Japan, respectively.
  • Use color to represent the values in nintendo.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Color the SPLOM of NA_Sales, EU_Sales, and JP_Sales by nintendo
vgsales2016 %>%
  mutate(nintendo = ifelse(Publisher == "Nintendo", "Nintendo", "Other")) %>%
  ___(___, colors = colors = c("orange", "black")) %>% 
  add_trace(
    ___,                                  
    dimensions = ___(
      ___, 
      ___,     
      ___       
    )
  )
Code bearbeiten und ausführen