Title: | Collecting Counter Strike Global Offensive Data |
---|---|
Description: | An implementation of calls designed to collect and organize in an easy way the data from the Steam API specifically for the Counter-Strike Global Offensive Game (CS Go) <https://developer.valvesoftware.com/wiki/Steam_Web_API>. |
Authors: | Adson Costanzi [aut, cre] , Rodrigo Fontoura [aut] |
Maintainer: | Adson Costanzi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.7 |
Built: | 2024-11-21 03:20:10 UTC |
Source: | https://github.com/adsoncostanzifilho/csgo |
This function will return all the CS Go Achievements of the user_id (input).
csgo_api_ach(api_key, user_id)
csgo_api_ach(api_key, user_id)
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
data frame with all the CS Go achievements of the user ID.
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_ach <- csgo_api_ach(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_ach <- csgo_api_ach(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
This function will return all the CS Go friends of the user_id (input).
csgo_api_friend(api_key, user_id)
csgo_api_friend(api_key, user_id)
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
data frame with all the CS Go friends of the user ID.
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_friend <- csgo_api_friend(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_friend <- csgo_api_friend(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
This function will return the CS Go Profile of the user_id (input).
csgo_api_profile(api_key, user_id, name = FALSE)
csgo_api_profile(api_key, user_id, name = FALSE)
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string OR list with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
name |
logical: if the user_id input is a name change it for TRUE. ex: 'kevinarndt'. PS: The query by name DOES NOT ALLOW a list of user_id. |
data frame with all the CS Go friends of the user ID.
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_profile <- csgo_api_profile(api_key = 'XXX', user_id = '76561198263364899') df_profile <- csgo_api_profile( api_key = 'XXX', user_id = list('76561198263364899','76561197996007619') ) df_profile <- csgo_api_profile(api_key = 'XXX', user_id = 'kevinarndt', name = TRUE) ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_profile <- csgo_api_profile(api_key = 'XXX', user_id = '76561198263364899') df_profile <- csgo_api_profile( api_key = 'XXX', user_id = list('76561198263364899','76561197996007619') ) df_profile <- csgo_api_profile(api_key = 'XXX', user_id = 'kevinarndt', name = TRUE) ## End(Not run)
This function will return all the CS Go Statistics of the user_id (input).
csgo_api_stats(api_key, user_id)
csgo_api_stats(api_key, user_id)
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
data frame with all the CS Go statistics of the user ID.
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_stats <- csgo_api_stats(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df_stats <- csgo_api_stats(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
This function will return the complete CS Go Statistics for all public friends of the user_id (input).
get_stats_friends(api_key, user_id, n_return = "all")
get_stats_friends(api_key, user_id, n_return = "all")
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
n_return |
numeric indicating the number of friends to return, to return all use n_return = "all" (the default is "all"). |
a list of two data frames
friends_stats: data frame with all the CS Go statistics of all public friends of the user ID.
friends: data frame with all the CS Go friends of the user ID (public and non public).
## Not run: ## It is necessary to fill the "api_key" parameter to run the example # set the "plan" to collect the data in parallel!!!! future::plan(future::multisession, workers = parallel::detectCores()) fr_list <- get_stats_friends(api_key = 'XXX', user_id = '76561198263364899') fr_list$friends_stats fr_list$friends ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example # set the "plan" to collect the data in parallel!!!! future::plan(future::multisession, workers = parallel::detectCores()) fr_list <- get_stats_friends(api_key = 'XXX', user_id = '76561198263364899') fr_list$friends_stats fr_list$friends ## End(Not run)
This function will return the complete CS Go Statistics of the user_id (input).
get_stats_user(api_key, user_id)
get_stats_user(api_key, user_id)
api_key |
string with the key provided by the steam API. PS: If you don't have a API key yet run |
user_id |
string with the steam user ID. Steam ID is the NUMBER OR NAME at the end of your steam profile URL. ex: '76561198263364899'. PS: The user should have a public status. |
Similar to the csgo_api_stats function but it will return a clean data frame with category and description of each statistic.
data frame with all the CS Go statistics (divided in categories and subcategories) of the user ID.
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df <- get_stats_user(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
## Not run: ## It is necessary to fill the "api_key" parameter to run the example df <- get_stats_user(api_key = 'XXX', user_id = '76561198263364899') ## End(Not run)
A dataset containing the pictures of each map.
map_pictures
map_pictures
A data frame with 34 rows and 2 variables:
Name of the map.
The image address.
...
Created by the author.
A color palette (color) to be used with ggplot2
scale_color_csgo(discrete = TRUE, ...)
scale_color_csgo(discrete = TRUE, ...)
discrete |
logical: if TRUE it will generate a discrete pallet otherwise a continuous palette |
... |
all available options of the |
scale_color
object
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = kills) %>% ggplot(aes(x = name_match, size = shots)) + geom_point(aes(y = kills_efficiency, color = "Kills Efficiency")) + geom_point(aes(y = hits_efficiency, color = "Hits Efficiency")) + geom_point(aes(y = hits_to_kill, color = "Hits to Kill")) + ggtitle("Weapon Efficiency") + ylab("Efficiency (%)") + xlab("") + labs(color = "Efficiency Type", size = "Shots") + theme_csgo( text = element_text(family = "quantico"), panel.grid.major.x = element_line(size = .1, color = "black",linetype = 2) ) + scale_color_csgo() ## End(Not run)
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = kills) %>% ggplot(aes(x = name_match, size = shots)) + geom_point(aes(y = kills_efficiency, color = "Kills Efficiency")) + geom_point(aes(y = hits_efficiency, color = "Hits Efficiency")) + geom_point(aes(y = hits_to_kill, color = "Hits to Kill")) + ggtitle("Weapon Efficiency") + ylab("Efficiency (%)") + xlab("") + labs(color = "Efficiency Type", size = "Shots") + theme_csgo( text = element_text(family = "quantico"), panel.grid.major.x = element_line(size = .1, color = "black",linetype = 2) ) + scale_color_csgo() ## End(Not run)
A color palette (fill) to be used with ggplot2
scale_fill_csgo(discrete = TRUE, ...)
scale_fill_csgo(discrete = TRUE, ...)
discrete |
logical: if TRUE it will generate a discrete pallet otherwise a continuous palette |
... |
all available options of the |
scale_color
object
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = value) %>% ggplot(aes(x = name_match, y = value, fill = name_match)) + geom_col() + ggtitle("KILLS BY WEAPON") + ylab("Number of Kills") + xlab("") + labs(fill = "Weapon Name") + theme_csgo(text = element_text(family = "quantico")) + scale_fill_csgo() ## End(Not run)
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = value) %>% ggplot(aes(x = name_match, y = value, fill = name_match)) + geom_col() + ggtitle("KILLS BY WEAPON") + ylab("Number of Kills") + xlab("") + labs(fill = "Weapon Name") + theme_csgo(text = element_text(family = "quantico")) + scale_fill_csgo() ## End(Not run)
A dataset containing the categories, descriptions and types of the statistics data pulled from the csgo_api_stats.
support
support
A data frame with 133 rows and 4 variables:
Name to match with the name statistics data.
Category name of the statistic.
Statistic description.
Statistic type.
...
Created by the author.
A CSGo theme to be used with ggplot2
theme_csgo(...)
theme_csgo(...)
... |
all available options of the |
theme
object
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = value) %>% ggplot(aes(x = name_match, y = value, fill = name_match)) + geom_col() + ggtitle("KILLS BY WEAPON") + ylab("Number of Kills") + xlab("") + labs(fill = "Weapon Name") + theme_csgo(text = element_text(family = "quantico")) ## End(Not run)
## Not run: library(CSGo) library(ggplot2) library(dplyr) library(showtext) ## Loading Google fonts (https://fonts.google.com/) font_add_google("Quantico", "quantico") df %>% top_n(n = 10, wt = value) %>% ggplot(aes(x = name_match, y = value, fill = name_match)) + geom_col() + ggtitle("KILLS BY WEAPON") + ylab("Number of Kills") + xlab("") + labs(fill = "Weapon Name") + theme_csgo(text = element_text(family = "quantico")) ## End(Not run)
A dataset containing the pictures of each map.
weapon_pictures
weapon_pictures
A data frame with 34 rows and 2 variables:
Name of the weapon.
The image address.
...
Created by the author.