0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ポケモンスケルトン(追記予定)

Last updated at Posted at 2020-09-10

稲葉直貴さんの以下のtweetを解く記事です。

rm(list = ls())

library(tidyverse)

d <- read_csv('poke.csv')
d <- d %>% mutate(S = map(name, function(str1){ return(1:str_length(str1)) }))
d <- d %>% unnest(cols = S)
d <- d %>% mutate(katakana = str_sub(name, S, S))

d1 <- d %>% group_by(katakana) %>% count()
d <- d %>% left_join(d1, by = c('katakana'))

以下を見ると、「ソ」は「フシギソウ」にしか使われていない様子。なので「フシギソウ」が4番目から分岐することはない。

> d
# A tibble: 673 x 5
   index name           S katakana     n
   <dbl> <chr>      <int> <chr>    <int>
 1     1 フシギダネ     1            9
 2     1 フシギダネ     2           13
 3     1 フシギダネ     3            6
 4     1 フシギダネ     4           10
 5     1 フシギダネ     5            2
 6     2 フシギソウ     1            9
 7     2 フシギソウ     2           13
 8     2 フシギソウ     3            6
 9     2 フシギソウ     4            1
10     2 フシギソウ     5           13
# ... with 663 more rows
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?