knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of overwatchr is to provide a framework for collecting and analyzing game statistics about public Overwatch accounts. The package relies on OWAPI to collect information from play.overwatch.com. It is not suitable for high-frequency querying, but aims to provide tools for users to analyze their long-term progression as Overwatch players. Currently, overwatchr only collects statistics from competitive gameplay.
The package consists of two main functions. The first function (scrape_ow_data) queries OWAPI for a specific profile and saves the data in a dedicated folder as multiple CSV files, one for each hero. This file structure supports multiple queries over time, which are appended to any existing CSV files, and can store data about multiple accounts. The second function (load_ow_data) loads this data into an R session for analysis. It also automatically transforms the raw information collected and stored by scrape_ow_data into more usable data by isolating gameplay between each OWAPI query, and by calculating stats per 10 minutes for each of these "sessions".
You can install overwatchr from GitHub with:
# install.packages("devtools") devtools::install_github("benbellman/overwatchr")
The first step to using the package is to attach it in your R session:
library(overwatchr)
Next, a user needs to start collecting data. I suggest running a query at least half an hour after each session of competitive play, as Overwatch's website does not seem to update profile stats very quickly. This is simple to do with scrape_ow_data. All you need to specify is the account name, the gaming platform, and the file path to store collected data.
# create an empty folder to store all future overwatch data # this function is from base R, not this package dir.create("~/Desktop/ow_data") # save new data query # future queries will be appended to same files automatically scrape_ow_data( profile_name = "catmaps", platform = "psn", file_path = "~/Desktop/ow_data" )
When loading data from this folder, load_ow_data() must pull data for a single hero, for a single account, and for a single season in order for data transformation to be reliable and accurate.
moira_data <- load_ow_data( profile_name = "catmaps", hero_table = "moira", season_choice = 19, file_path = "~/Desktop/ow_data" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.