Sample R script with Marvel Comics data

 

Are there significantly more appearances of X-Men or Avengers characters in the Marvel Universe? Well, we haven’t quite answered the question, but this data and script play with the topic. Links and notes below:

  • marvel0_modified.csv
    • Notes: This csv contains data onΒ the first 100 characters from the Marvel API (thanks Sweta). Because the column names are difficult to parse (in that the special charater “/” is frequently used),Β I modified the 11th column name from “comics/items/0/name” to “firstcomicname.”
  • Marvel.R
    • If you run the entire script in R, you’ll see a comparison between characters classified as X-Men and characters classified as Avengers.Β I used a rough classification:
      • xmen = characters whose firstcomicname contains “X-Men”
      • avengers = characters whose firstcomicname contains “Avengers”

I hope you can use this script to help form your own analysesΒ for your final datasets!