【R】datateachr
2020年12月29日
1. はじめに
datateachr
は、主に教育目的でオープンソースデータに容易にアクセスできるようにしてくれるパッケージです。いくつものソースからまとめたデータが含まれています。
2. インストール
Githubからインストールします。
devtools::install_github("UBC-MDS/datateachr")
3. 使ってみる
以下のデータセットが含まれているようです。
apt_buildings
: Acquired courtesy of The City of Toronto’s Open Data Portal. It currently has 3455 rows and 37 columns.building_permits
: Acquired courtesy of The City of Vancouver’s Open Data Portal. It currently has 20680 rows and 14 columns.cancer_sample
: Acquired courtesy of UCI Machine Learning Repository. It currently has 569 rows and 32 columns.flow_sample
: Acquired courtesy of The Government of Canada’s Historical Hydrometric Database. It currently has 218 rows and 7 columns.parking_meters
: Acquired courtesy of The City of Vancouver’s Open Data Portal. It currently has 10032 rows and 22 columns.steam_games
: Acquired courtesy of Kaggle. It currently has 40833 rows and 21 columns.vancouver_trees
: Acquired courtesy of The City of Vancouver’s Open Data Portal. It currently has 146611 rows and 20 columns.
使ってみます。
library(datateachr) vancouver_trees
> vancouver_trees
# A tibble: 146,611 x 20
tree_id civic_number std_street genus_name species_name cultivar_name common_name
<dbl> <dbl> <chr> <chr> <chr> <chr> <chr>
1 149556 494 W 58TH AV ULMUS AMERICANA BRANDON BRANDON ELM
2 149563 450 W 58TH AV ZELKOVA SERRATA NA JAPANESE Z~
3 149579 4994 WINDSOR ST STYRAX JAPONICA NA JAPANESE S~
4 149590 858 E 39TH AV FRAXINUS AMERICANA AUTUMN APPLA~ AUTUMN APP~
5 149604 5032 WINDSOR ST ACER CAMPESTRE NA HEDGE MAPLE
6 149616 585 W 61ST AV PYRUS CALLERYANA CHANTICLEER CHANTICLEE~
7 149617 4909 SHERBROOK~ ACER PLATANOIDES COLUMNARE COLUMNAR N~
8 149618 4925 SHERBROOK~ ACER PLATANOIDES COLUMNARE COLUMNAR N~
9 149619 4969 SHERBROOK~ ACER PLATANOIDES COLUMNARE COLUMNAR N~
10 149625 720 E 39TH AV FRAXINUS AMERICANA AUTUMN APPLA~ AUTUMN APP~
# ... with 146,601 more rows, and 13 more variables: assigned <chr>, root_barrier <chr>,
# plant_area <chr>, on_street_block <dbl>, on_street <chr>, neighbourhood_name <chr>,
# street_side_name <chr>, height_range_id <dbl>, diameter <dbl>, curb <chr>,
# date_planted <date>, longitude <dbl>, latitude <dbl>
library(datateachr) library(ggplot2) library(tidyverse) flow_sample %>% ggplot()+ geom_point(aes(year, flow))
4. さいごに
いろいろなデータを手軽に使えそうですね。