Visualizing Pokemon
Let's try visualizing the pokemon data. There are a lot of variables in the pokemon dataset, so let's only select a few that we really want to use as cognostics.
This exercise is part of the course
Visualizing Big Data with Trelliscope in R
Exercise instructions
- Reduce the variables in the dataset down to
pokemon,type_1,attack,generation_id, andurl_imageusing dplyr'sselect(). - Re-specify the variable
pokemonso that the Pokemon's names show up as a labels in the display by default by using thecog()function. - Specify a new variable,
panel, that points trelliscope to theurl_imagevariable for panel plotting. - Create the display using
trelliscope()and name it"pokemon"and set it to have 3 rows and 6 columns by default.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
library(dplyr)
library(trelliscopejs)
# Create a new data frame to use for plotting
pokemon2 <- pokemon %>%
# Reduce the variables in the dataset
select(pokemon, type_1, attack, generation_id, url_image) %>%
mutate(
# Respecify pokemon
pokemon = cog(val = ___, default_label = ___),
# Create panel variable
panel = img_panel(___)
)
# Create the display
trelliscope(pokemon2, ___)