Hi Selina,
Thank you for your post – it looks like the scatterplot3js has been updated so that it only accepts matrices as the data input (you can view this documentation by entering ?scatterplot3js
). This means that we need to put as.matrix
in front of the subsetted data, and close it with an extra parenthesis:
scatterplot3js(as.matrix(subset(house_votes_color_Dem,
select = c("aye", "nay", "other"))),
# renderer = "canvas", # <- makes the points round
color = house_votes_color_Dem$color,
flip.y = FALSE, # <- makes the y-axis go from small
# to large values starting from
# the x-axis
labels = house_votes_color_Dem$Last.Name) # <- shows the
# Rep's name
# when you
# scroll over
You’ll notice that I also commented out the ‘renderer’ argument, as it seems to have been temporarily disabled by the creator of this package. When you run this code, the chart should appear. Please let me know if that works!
Best,
Merav