EPL,MLB,NBA,NFL,NHLチームカラーのパレットを利用できるパッケージです。面白いと思います。カラーパレットの表示には便利な「scales」パッケージを使用しています。
パッケージバージョンは1.0.0。実行コマンドはwindows 11のR version 4.1.2で確認しています。
パッケージのインストール
下記コマンドを実行してください。
#パッケージのインストール install.packages("colorr")
コマンドの紹介
詳細はコマンド、各パッケージのヘルプを確認してください。
#パッケージの読み込み library("colorr") library("scales") #EPLチームカラー:epl.colorsコマンド #カラーパレット名 TeamNmaes <- c("arsenal", "bournemouth", "burnley", "chelsea", "crystal_palace", "everton", "hull", "leicester", "liverpool", "man_city", "man_united", "middlesbrough", "southampton", "stoke_city", "sunderland", "swansea_city", "tottenham", "watford", "west_bromich_albion", "west_ham") par(mfrow = c(5, 4), bg = "#2E2E2E") for(i in seq(TeamNmaes)){ show_col(epl.colors(TeamNmaes[i]), labels = FALSE) text(1, 0, TeamNmaes[i], col = "white") } #MLBチームカラー:mlb.colorsコマンド #カラーパレット名 TeamNmaes <- c("braves", "orioles", "red_sox", "cubs", "white_sox", "reds", "indians", "rockies", "tigers", "astros", "royals", "angels", "dodgers", "marlins", "brewers", "twins", "mets", "yankees", "athletics", "phillies", "pirates", "padres", "giants", "mariners", "cardinals", "rays", "rangers", "blue_jays", "nationals") par(mfrow = c(5, 6), bg = "#2E2E2E") for(i in seq(TeamNmaes)){ show_col(mlb.colors(TeamNmaes[i]), labels = FALSE) text(1, 0, TeamNmaes[i], col = "white") } #NBAチームカラー:nba.colorsコマンド #カラーパレット名 TeamNmaes <- c("hawks", "hornets", "mavs", "warriors", "clippers", "heat", "pelicans", "magic", "blazers", "raptors", "celtics", "bulls", "nuggets", "rockets", "lakers", "bucks", "knicks", "sixers", "kings", "jazz", "nets", "cavs", "pistons", "pacers", "grizzlies", "wolves", "thunder", "suns", "spurs", "wizards", "sonics") par(mfrow = c(5, 7), bg = "#2E2E2E") for(i in seq(TeamNmaes)){ show_col(nba.colors(TeamNmaes[i]), labels = FALSE) text(1, 0, TeamNmaes[i], col = "white") } #NFLチームカラー:nfl.colorsコマンド #カラーパレット名 TeamNmaes <- c("cardinals", "falcons", "ravens", "bills", "panthers", "bears", "bengals", "browns", "cowboys", "broncos", "lions", "packers", "texans", "colts", "jaguars", "chiefs", "chargers", "rams", "dolphins", "vikings", "saints", "giants", "jets", "raiders", "eagles", "steelers", "niners", "seahawks", "buccaneers", "titans", "redskins") par(mfrow = c(5, 7), bg = "#2E2E2E") for(i in seq(TeamNmaes)){ show_col(nfl.colors(TeamNmaes[i]), labels = FALSE) text(1, 0, TeamNmaes[i], col = "white") } #NHLチームカラー:nhl.colorsコマンド #カラーパレット名 TeamNmaes <- c("ducks", "coyotes", "bruins", "sabres", "flames", "hurricanes", "avalanche", "blue_jackets", "stars", "red_wings", "oilers", "panthers", "kings", "wild", "canadiens", "predators", "devils", "islanders", "rangers", "senators", "flyers", "penguins", "sharks", "blues", "lightning", "maple_leafs", "canucks", "golden_knights", "capitals", "jets") par(mfrow = c(5, 6), bg = "#2E2E2E") for(i in seq(TeamNmaes)){ show_col(nhl.colors(TeamNmaes[i]), labels = FALSE) text(1, 0, TeamNmaes[i], col = "white") }
出力例
・epl.colorsコマンド
・mlb.colorsコマンド
・nba.colorsコマンド
・nfl.colorsコマンド
・nhl.colorsコマンド
少しでも、あなたの解析が楽になりますように!!