diff --git a/_pkgdown.yml b/_pkgdown.yml index 19d20b4..0abdd7f 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -41,9 +41,16 @@ reference: - pitch_to_df - intensity_to_df - formant_to_df + - df_to_eaf + - df_to_exb + - remove_textgrid_tier - read_from_folder - title: Create an interactive viewer desc: Extracct sound and spectrograms from your data and merge them into the interactive table - contents: - extract_intervals - create_glossed_document + - add_leading_symbols + - create_image_look_up + - create_sound_play + - create_viewer diff --git a/codemeta.json b/codemeta.json index aa3d2be..ba2a1c1 100644 --- a/codemeta.json +++ b/codemeta.json @@ -14,7 +14,7 @@ "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.2.0 (2022-04-22)", + "runtimePlatform": "R version 4.2.1 (2022-06-23)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -233,9 +233,21 @@ "identifier": "tools", "name": "tools" }, + "11": { + "@type": "SoftwareApplication", + "identifier": "mime", + "name": "mime", + "provider": { + "@id": "https://cran.r-project.org", + "@type": "Organization", + "name": "Comprehensive R Archive Network (CRAN)", + "url": "https://cran.r-project.org" + }, + "sameAs": "https://CRAN.R-project.org/package=mime" + }, "SystemRequirements": "pandoc (>= 1.14) - http://pandoc.org" }, - "fileSize": "4227.246KB", + "fileSize": "4224.739KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/docs/404.html b/docs/404.html index c92f193..e83616c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -106,7 +106,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.3.

+

Site built with pkgdown 2.0.6.

diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index d78f450..c10edd8 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -90,7 +90,7 @@

Issues<
-

Site built with pkgdown 2.0.3.

+

Site built with pkgdown 2.0.6.

diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index 4384e9e..1f2a98d 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -360,7 +360,7 @@

License

-

Site built with pkgdown 2.0.3.

+

Site built with pkgdown 2.0.6.

diff --git a/docs/additional/glossed_document.docx b/docs/additional/glossed_document.docx index 7e9f707..a4e3da2 100644 Binary files a/docs/additional/glossed_document.docx and b/docs/additional/glossed_document.docx differ diff --git a/docs/additional/glossed_document.html b/docs/additional/glossed_document.html index e030b31..831181a 100644 --- a/docs/additional/glossed_document.html +++ b/docs/additional/glossed_document.html @@ -383,8 +383,8 @@

2017.04 Fairytale about the rooster

Когда колючка воткнулась, [он] ушел к Бихтаю.

5. бихьтай=ло ишуишу й-ис-он-ч1игу Гъули-ди , гьеге-й=ло ссу енш-ч1у-кку=ло р-ухх-и р-иъ-е-сса=ду б-укъ-и-й =гъоди гьербади .

Бихтай=add дома-дома f-находить-pst(aor)-neg.cvb Гъули-erg dem-f=add neg.cop rfl-ad-el=add ¬an2-вынимать-pst(aor) ¬an2-приходить-¬pst-neg.fut=quot an-гнать-pst-pf =rep прочь

-

Гъули не обнаружил дома Бихтай, дома ее нет, из себя не вынул и -пошел дальше.

+

Гъули не обнаружил дома Бихтай, дома ее нет, из себя не вынул и пошел +дальше.

6. б-uʔ-oн-ни=гъоди гьербади гьелъу-кку Умалай-хо , Умалай-ди букъийгъоди гьел-ъо ссу=гъо ден реъун-ни-й хур-ди=гъо й-иъ-ин-не=ду .

an-идти-pst-pst(aor)=rep прочь там-el Умалай-ad.lat Умалай-erg dem.obl-sup.lat neg.cop=quot я быть_свободным-pst-cvb поле-lat=quot f-приходить-¬pst-hab=quot

Оттуда пошел к Умалаю,

@@ -411,8 +411,8 @@

2017.04 Fairytale about the rooster

Три дня не ели, мы с ней не зная, сказал он.

14. гье-лъу-кку б–и-йб–и-й б-охъ-о-йб-охъ-о-й -хо гьеге-й=ло й-ис-он-ч1игу lа Загьраъил-хо .

dem-dat-el an–pst(aor)-cvb(pf)-an–pst(aor)-cvb(pf) an-дойти-pst-cvb(pf)-an-дойти-pst-cvb(pf) - -apud.lat dem-f=add f-находить–neg.cvb -sup- Захрай.obl-apud.lat

-

Оттуда он ушёл и дошёл до Айшат Исмаиловой и её не обнаружив, он -ушёл и дошёл до Захраил Шамиля.

+

Оттуда он ушёл и дошёл до Айшат Исмаиловой и её не обнаружив, он ушёл +и дошёл до Захраил Шамиля.

15. й–и-й Загьраъил-ди=ло б-укъ-и-й .

f–pst(aor)-cvb(pf) Захрай.obl-erg=add an-гнать-pst-pf

Захраил …?

diff --git "a/docs/additional/s1_pics/1_s1_\304\261.png" "b/docs/additional/s1_pics/1_s1_\304\261.png" index 209b380..8c377e0 100644 Binary files "a/docs/additional/s1_pics/1_s1_\304\261.png" and "b/docs/additional/s1_pics/1_s1_\304\261.png" differ diff --git "a/docs/additional/s1_pics/2_s1_\303\246.png" "b/docs/additional/s1_pics/2_s1_\303\246.png" index e6df5f7..540a351 100644 Binary files "a/docs/additional/s1_pics/2_s1_\303\246.png" and "b/docs/additional/s1_pics/2_s1_\303\246.png" differ diff --git "a/docs/additional/s1_sounds/1_s1_\304\261.wav" "b/docs/additional/s1_sounds/1_s1_\304\261.wav" index f73c1cf..1ffebcf 100644 Binary files "a/docs/additional/s1_sounds/1_s1_\304\261.wav" and "b/docs/additional/s1_sounds/1_s1_\304\261.wav" differ diff --git "a/docs/additional/s1_sounds/2_s1_\303\246.wav" "b/docs/additional/s1_sounds/2_s1_\303\246.wav" index 38a2bbd..3a70b69 100644 Binary files "a/docs/additional/s1_sounds/2_s1_\303\246.wav" and "b/docs/additional/s1_sounds/2_s1_\303\246.wav" differ diff --git a/docs/additional/stimuli_viewer.html b/docs/additional/stimuli_viewer.html index 55c1e69..3f2bb3b 100644 --- a/docs/additional/stimuli_viewer.html +++ b/docs/additional/stimuli_viewer.html @@ -1306,6 +1306,13 @@ type: "output", renderOnNullValue: true, initialize: function(el, width, height) { + // in order that the type=number inputs return a number + $.valHooks.number = { + get: function(el) { + var value = parseFloat(el.value); + return isNaN(value) ? "" : value; + } + }; $(el).html(' '); return { data: null, @@ -3424,8 +3431,8 @@

Sound Viewer

data

-
- +
+
×
diff --git a/docs/additional/stimuli_viewer2.html b/docs/additional/stimuli_viewer2.html index 9f12ac1..d9d262e 100644 --- a/docs/additional/stimuli_viewer2.html +++ b/docs/additional/stimuli_viewer2.html @@ -5303,6 +5303,13 @@ type: "output", renderOnNullValue: true, initialize: function(el, width, height) { + // in order that the type=number inputs return a number + $.valHooks.number = { + get: function(el) { + var value = parseFloat(el.value); + return isNaN(value) ? "" : value; + } + }; $(el).html(' '); return { data: null, @@ -7421,8 +7428,8 @@

Sound Viewer

map

-
- +
+
×
@@ -7432,8 +7439,8 @@

map

data

-
- +
+
×
diff --git a/docs/articles/data_manipulation_with_tidyverse.html b/docs/articles/data_manipulation_with_tidyverse.html index bc73764..effb2a2 100644 --- a/docs/articles/data_manipulation_with_tidyverse.html +++ b/docs/articles/data_manipulation_with_tidyverse.html @@ -92,7 +92,7 @@

George Moroz, Laboratory

-

2022-05-09

+

2022-09-23

Source: vignettes/data_manipulation_with_tidyverse.Rmd @@ -115,10 +115,10 @@

Introduction
-install.packages("tidyverse")

+install.packages("tidyverse")

Let’s load the package:

+library("tidyverse")

.TextGrid, .eaf, .exb formats @@ -128,39 +128,39 @@

.TextGrid, .eaf, .exb formats

If we convert this file to R we will achieve something like this:

-textgrid_to_df("s1/s1_all.TextGrid")
-#>    id time_start  time_end      content tier     tier_name          source
-#> 1   1  0.0000000 0.4821542          tip    1        labels s1_all.TextGrid
-#> 4   1  0.0000000 0.4821542 1_s1_tip.wav    2 backup labels s1_all.TextGrid
-#> 7   1  0.0000000 0.1072426                 3               s1_all.TextGrid
-#> 8   2  0.1072426 0.1887230            ı    3               s1_all.TextGrid
-#> 9   3  0.1887230 0.4821542                 3               s1_all.TextGrid
-#> 2   2  0.4821542 0.9120635          tap    1        labels s1_all.TextGrid
-#> 5   2  0.4821542 0.9120635 2_s1_tap.wav    2 backup labels s1_all.TextGrid
-#> 10  4  0.4821542 0.5770552                 3               s1_all.TextGrid
-#> 11  5  0.5770552 0.6793392            æ    3               s1_all.TextGrid
-#> 12  6  0.6793392 0.9120635                 3               s1_all.TextGrid
-#> 3   3  0.9120635 1.3942177          top    1        labels s1_all.TextGrid
-#> 6   3  0.9120635 1.3942177 3_s1_top.wav    2 backup labels s1_all.TextGrid
-#> 13  7  0.9120635 1.0364661                 3               s1_all.TextGrid
-#> 14  8  1.0364661 1.1066780            ɒ    3               s1_all.TextGrid
-#> 15  9  1.1066780 1.3942177                 3               s1_all.TextGrid
+textgrid_to_df("s1/s1_all.TextGrid") +#> id time_start time_end content tier tier_name source +#> 1 1 0.0000000 0.4821542 tip 1 labels s1_all.TextGrid +#> 4 1 0.0000000 0.4821542 1_s1_tip.wav 2 backup labels s1_all.TextGrid +#> 7 1 0.0000000 0.1072426 3 s1_all.TextGrid +#> 8 2 0.1072426 0.1887230 ı 3 s1_all.TextGrid +#> 9 3 0.1887230 0.4821542 3 s1_all.TextGrid +#> 2 2 0.4821542 0.9120635 tap 1 labels s1_all.TextGrid +#> 5 2 0.4821542 0.9120635 2_s1_tap.wav 2 backup labels s1_all.TextGrid +#> 10 4 0.4821542 0.5770552 3 s1_all.TextGrid +#> 11 5 0.5770552 0.6793392 æ 3 s1_all.TextGrid +#> 12 6 0.6793392 0.9120635 3 s1_all.TextGrid +#> 3 3 0.9120635 1.3942177 top 1 labels s1_all.TextGrid +#> 6 3 0.9120635 1.3942177 3_s1_top.wav 2 backup labels s1_all.TextGrid +#> 13 7 0.9120635 1.0364661 3 s1_all.TextGrid +#> 14 8 1.0364661 1.1066780 ɒ 3 s1_all.TextGrid +#> 15 9 1.1066780 1.3942177 3 s1_all.TextGrid

As we see this table has a long format structure: each observation has its own row. We can select the first two rows with the filter() function, remove all unnecessary columns with the select() function and spread everything in a table with the pivot_wider() function:

-textgrid_to_df("s1/s1_all.TextGrid") %>% 
-  filter(tier %in% 1:2) %>% 
-  select(-time_start, -time_end, -tier_name) %>% 
-  pivot_wider(names_from = tier, values_from = content)
-#> # A tibble: 3 × 4
-#>      id source          `1`   `2`         
-#>   <dbl> <chr>           <chr> <chr>       
-#> 1     1 s1_all.TextGrid tip   1_s1_tip.wav
-#> 2     2 s1_all.TextGrid tap   2_s1_tap.wav
-#> 3     3 s1_all.TextGrid top   3_s1_top.wav
+textgrid_to_df("s1/s1_all.TextGrid") %>% + filter(tier %in% 1:2) %>% + select(-time_start, -time_end, -tier_name) %>% + pivot_wider(names_from = tier, values_from = content) +#> # A tibble: 3 × 4 +#> id source `1` `2` +#> <dbl> <chr> <chr> <chr> +#> 1 1 s1_all.TextGrid tip 1_s1_tip.wav +#> 2 2 s1_all.TextGrid tap 2_s1_tap.wav +#> 3 3 s1_all.TextGrid top 3_s1_top.wav

.flextext format @@ -168,64 +168,63 @@

.flextext formatImagine that we obtained the first result from flextext_to_df():

-df <- flextext_to_df("files/zilo_test.flextext")
-#> It can take some time for big files...
-head(df)
-#>   p_id s_id w_id    txt     cf hn     gls                   msa                free_trans
-#> 1    1    1    1     б-     б-  1      an Inflects any category Жил-был (у Гъули?) петух.
-#> 2    1    1    1    ик1    ик1  1    быть                    гл Жил-был (у Гъули?) петух.
-#> 3    1    1    1     -о     -о  1     pst               гл:Past Жил-был (у Гъули?) петух.
-#> 4    1    1    1     -й     -й  5 cvb(pf)    гл:Converb/Perfect Жил-был (у Гъули?) петух.
-#> 5    1    1    1 =гъоди =гъоди  1    =rep                  част Жил-был (у Гъули?) петух.
-#> 6    1    1    2     б-     б-  1      an Inflects any category Жил-был (у Гъули?) петух.
-#>                            text_title                                morph
-#> 1 2017.04 Fairytale about the rooster d7f713db-e8cf-11d3-9764-00c04f186933
-#> 2 2017.04 Fairytale about the rooster d7f713e8-e8cf-11d3-9764-00c04f186933
-#> 3 2017.04 Fairytale about the rooster d7f713dd-e8cf-11d3-9764-00c04f186933
-#> 4 2017.04 Fairytale about the rooster d7f713dd-e8cf-11d3-9764-00c04f186933
-#> 5 2017.04 Fairytale about the rooster d7f713e1-e8cf-11d3-9764-00c04f186933
-#> 6 2017.04 Fairytale about the rooster d7f713db-e8cf-11d3-9764-00c04f186933
-#>                                   word                               phrase
-#> 1 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#> 2 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#> 3 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#> 4 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#> 5 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#> 6 c76d26b7-b84a-42a8-ba34-38e712b1db13 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13
-#>                              paragraph                                 text
-#> 1 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
-#> 2 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
-#> 3 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
-#> 4 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
-#> 5 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
-#> 6 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7
+df <- flextext_to_df("files/zilo_test.flextext") +head(df) +#> p_id s_id w_id txt cf hn gls msa free_trans +#> 1 1 1 1 б- б- 1 an Inflects any category Жил-был (у Гъули?) петух. +#> 2 1 1 1 ик1 ик1 1 быть гл Жил-был (у Гъули?) петух. +#> 3 1 1 1 -о -о 1 pst гл:Past Жил-был (у Гъули?) петух. +#> 4 1 1 1 -й -й 5 cvb(pf) гл:Converb/Perfect Жил-был (у Гъули?) петух. +#> 5 1 1 1 =гъоди =гъоди 1 =rep част Жил-был (у Гъули?) петух. +#> 6 1 1 2 б- б- 1 an Inflects any category Жил-был (у Гъули?) петух. +#> text_title morph +#> 1 2017.04 Fairytale about the rooster d7f713db-e8cf-11d3-9764-00c04f186933 +#> 2 2017.04 Fairytale about the rooster d7f713e8-e8cf-11d3-9764-00c04f186933 +#> 3 2017.04 Fairytale about the rooster d7f713dd-e8cf-11d3-9764-00c04f186933 +#> 4 2017.04 Fairytale about the rooster d7f713dd-e8cf-11d3-9764-00c04f186933 +#> 5 2017.04 Fairytale about the rooster d7f713e1-e8cf-11d3-9764-00c04f186933 +#> 6 2017.04 Fairytale about the rooster d7f713db-e8cf-11d3-9764-00c04f186933 +#> word phrase +#> 1 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> 2 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> 3 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> 4 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> 5 efafb420-e203-4685-9be2-1b7810f10a70 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> 6 c76d26b7-b84a-42a8-ba34-38e712b1db13 1cbadc4f-4051-4783-a0d8-bfeee2d2fb13 +#> paragraph text +#> 1 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7 +#> 2 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7 +#> 3 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7 +#> 4 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7 +#> 5 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7 +#> 6 0c9ffe63-b4bf-4af3-a1da-f68567e03513 f08dd466-fca6-4597-925c-c46309387ef7

As we can see from df print there are three indices in the dataset: p_id – paragraph id, s_id – sentence id and w_id – word id.

-df %>% 
-  filter(free_trans != "") %>% 
-  select(p_id, s_id, w_id, txt, gls, free_trans) %>% 
-  group_by(p_id, s_id, free_trans, w_id) %>% 
-  summarise(txt = str_c(txt, collapse = ""),
-         gls = str_c(gls, collapse = "-"))
-#> `summarise()` has grouped output by 'p_id', 's_id', 'free_trans'. You can override using the `.groups`
-#> argument.
-#> # A tibble: 136 × 6
-#> # Groups:   p_id, s_id, free_trans [19]
-#>     p_id  s_id free_trans                        w_id txt              gls                       
-#>    <dbl> <dbl> <chr>                            <dbl> <chr>            <chr>                     
-#>  1     1     1 Жил-был (у Гъули?) петух.            1 б-ик1-о-й=гъоди  "an-быть-pst-cvb(pf)-=rep"
-#>  2     1     1 Жил-был (у Гъули?) петух.            2 б--о-ч1игу=гъоди "an--pst-neg.cvb-=rep"    
-#>  3     1     1 Жил-был (у Гъули?) петух.            3 Гъули-б          "Гъули-an(gen)"           
-#>  4     1     1 Жил-был (у Гъули?) петух.            4 х1елеко          "петух"                   
-#>  5     1     1 Жил-был (у Гъули?) петух.            5 .                ""                        
-#>  6     2     2 Он грелся на улице(?).               6 къват1и-ла=гъоди "улица-in-=rep"           
-#>  7     2     2 Он грелся на улице(?).               7 б-ик1-о-j        "an-быть-pst-cvb(pf)"     
-#>  8     2     2 Он грелся на улице(?).               8 букьир-ъа        "Букир-sup"               
-#>  9     2     2 Он грелся на улице(?).               9 .                ""                        
-#> 10     2     3 [Ему в ногу] воткнулась колючка.    10 къинни-й=гъоди   "втыкаться-cvb(pf)-=rep"  
-#> # … with 126 more rows
+df %>% + filter(free_trans != "") %>% + select(p_id, s_id, w_id, txt, gls, free_trans) %>% + group_by(p_id, s_id, free_trans, w_id) %>% + summarise(txt = str_c(txt, collapse = ""), + gls = str_c(gls, collapse = "-")) +#> `summarise()` has grouped output by 'p_id', 's_id', 'free_trans'. You can override using the `.groups` +#> argument. +#> # A tibble: 136 × 6 +#> # Groups: p_id, s_id, free_trans [19] +#> p_id s_id free_trans w_id txt gls +#> <dbl> <dbl> <chr> <dbl> <chr> <chr> +#> 1 1 1 Жил-был (у Гъули?) петух. 1 б-ик1-о-й=гъоди "an-быть-pst-cvb(pf)-=rep" +#> 2 1 1 Жил-был (у Гъули?) петух. 2 б--о-ч1игу=гъоди "an--pst-neg.cvb-=rep" +#> 3 1 1 Жил-был (у Гъули?) петух. 3 Гъули-б "Гъули-an(gen)" +#> 4 1 1 Жил-был (у Гъули?) петух. 4 х1елеко "петух" +#> 5 1 1 Жил-был (у Гъули?) петух. 5 . "" +#> 6 2 2 Он грелся на улице(?). 6 къват1и-ла=гъоди "улица-in-=rep" +#> 7 2 2 Он грелся на улице(?). 7 б-ик1-о-j "an-быть-pst-cvb(pf)" +#> 8 2 2 Он грелся на улице(?). 8 букьир-ъа "Букир-sup" +#> 9 2 2 Он грелся на улице(?). 9 . "" +#> 10 2 3 [Ему в ногу] воткнулась колючка. 10 къинни-й=гъоди "втыкаться-cvb(pf)-=rep" +#> # … with 126 more rows

The first filter() removes some garbage rows that are present in our example flextext. The select() function selects only six important columns from 15 presented in the dataset. The @@ -236,68 +235,68 @@

.flextext formatSo now we can use the same code in order to merge everything into sentences:

-df %>% 
-  filter(free_trans != "") %>% 
-  select(p_id, s_id, w_id, txt, gls, free_trans) %>% 
-  group_by(p_id, s_id, free_trans, w_id) %>% 
-  summarise(txt = str_c(txt, collapse = ""),
-         gls = str_c(gls, collapse = "-")) %>% 
-  group_by(p_id, s_id, free_trans) %>% 
-  summarise(txt = str_c(txt, collapse = " "),
-         gls = str_c(gls, collapse = " "))
-#> `summarise()` has grouped output by 'p_id', 's_id', 'free_trans'. You can override using the `.groups`
-#> argument.
-#> `summarise()` has grouped output by 'p_id', 's_id'. You can override using the `.groups` argument.
-#> # A tibble: 19 × 5
-#> # Groups:   p_id, s_id [19]
-#>     p_id  s_id free_trans                                                                   txt   gls  
-#>    <dbl> <dbl> <chr>                                                                        <chr> <chr>
-#>  1     1     1 "Жил-был (у Гъули?) петух."                                                  б-ик… "an-…
-#>  2     2     2 "Он грелся на улице(?)."                                                     къва… "ули…
-#>  3     2     3 "[Ему в ногу] воткнулась колючка."                                           къин… "вты…
-#>  4     3     4 "Когда колючка воткнулась, [он] ушел к Бихтаю."                              ццан… "кол…
-#>  5     4     5 "Гъули не обнаружил дома Бихтай, дома ее нет, из себя не вынул и пошел даль… бихь… "Бих…
-#>  6     5     6 "Оттуда пошел к Умалаю, "                                                    б-uʔ… "an-…
-#>  7     6     7 "Оттуда петух пошел к Патимат."                                              х1ел… "пет…
-#>  8     8    10 "Оттуда [петух] пошел к Ханичай."                                            гье-… "dem…
-#>  9     9    11 "Иди к Хурмат, ..."                                                          хъан… "Хан…
-#> 10    10    12 "Когда дошёл до двора Хурмат, из окна появился мальчик, сказал:"             рул1… "гов…
-#> 11    11    13 "Три дня не ели, мы с ней не зная, сказал он."                               рул1… "гов…
-#> 12    12    14 "Оттуда он ушёл и дошёл до Айшат Исмаиловой и её не обнаружив, он ушёл и до… гье-… "dem…
-#> 13    13    15 "Захраил …?"                                                                 й--и… "f--…
-#> 14    14    16 "И он пошел в село. Захраил сказала, что колючка воткнулась в петуха."       б-ук… "an-…
-#> 15    15    17 "Оттуда снизу вверх к Исрапилу ..."                                          гьег… "там…
-#> 16    16    18 "Шли-шли и пришли к Гаджи."                                                  гье-… "dem…
-#> 17    17    19 "Они поссорились (?) и прогнали (?) петуха."                                 й-ей… "f-р…
-#> 18    18    20 "Когда закончили ссориться, [пошли?] к Забиту."                              джид… "дел…
-#> 19    19    21 "На воротах Забита петух обнаружил замок и пошел к Зумайрат."                х1ел… "пет…
+df %>% + filter(free_trans != "") %>% + select(p_id, s_id, w_id, txt, gls, free_trans) %>% + group_by(p_id, s_id, free_trans, w_id) %>% + summarise(txt = str_c(txt, collapse = ""), + gls = str_c(gls, collapse = "-")) %>% + group_by(p_id, s_id, free_trans) %>% + summarise(txt = str_c(txt, collapse = " "), + gls = str_c(gls, collapse = " ")) +#> `summarise()` has grouped output by 'p_id', 's_id', 'free_trans'. You can override using the `.groups` +#> argument. +#> `summarise()` has grouped output by 'p_id', 's_id'. You can override using the `.groups` argument. +#> # A tibble: 19 × 5 +#> # Groups: p_id, s_id [19] +#> p_id s_id free_trans txt gls +#> <dbl> <dbl> <chr> <chr> <chr> +#> 1 1 1 "Жил-был (у Гъули?) петух." б-ик… "an-… +#> 2 2 2 "Он грелся на улице(?)." къва… "ули… +#> 3 2 3 "[Ему в ногу] воткнулась колючка." къин… "вты… +#> 4 3 4 "Когда колючка воткнулась, [он] ушел к Бихтаю." ццан… "кол… +#> 5 4 5 "Гъули не обнаружил дома Бихтай, дома ее нет, из себя не вынул и пошел дальше." бихь… "Бих… +#> 6 5 6 "Оттуда пошел к Умалаю, " б-uʔ… "an-… +#> 7 6 7 "Оттуда петух пошел к Патимат." х1ел… "пет… +#> 8 8 10 "Оттуда [петух] пошел к Ханичай." гье-… "dem… +#> 9 9 11 "Иди к Хурмат, ..." хъан… "Хан… +#> 10 10 12 "Когда дошёл до двора Хурмат, из окна появился мальчик, сказал:" рул1… "гов… +#> 11 11 13 "Три дня не ели, мы с ней не зная, сказал он." рул1… "гов… +#> 12 12 14 "Оттуда он ушёл и дошёл до Айшат Исмаиловой и её не обнаружив, он ушёл и дошёл до… гье-… "dem… +#> 13 13 15 "Захраил …?" й--и… "f--… +#> 14 14 16 "И он пошел в село. Захраил сказала, что колючка воткнулась в петуха." б-ук… "an-… +#> 15 15 17 "Оттуда снизу вверх к Исрапилу ..." гьег… "там… +#> 16 16 18 "Шли-шли и пришли к Гаджи." гье-… "dem… +#> 17 17 19 "Они поссорились (?) и прогнали (?) петуха." й-ей… "f-р… +#> 18 18 20 "Когда закончили ссориться, [пошли?] к Забиту." джид… "дел… +#> 19 19 21 "На воротах Забита петух обнаружил замок и пошел к Зумайрат." х1ел… "пет…

It is also very easy to get some simple statistics from the data:

-df %>% 
-  filter(gls != "") %>% 
-  count(gls) %>% 
-  top_n(6)
-#> Selecting by n
-#>        gls  n
-#> 1     =add 46
-#> 2     ¬an1 34
-#> 3       an 49
-#> 4  cvb(pf) 63
-#> 5      pst 28
-#> 6 pst(aor) 74
+df %>% + filter(gls != "") %>% + count(gls) %>% + top_n(6) +#> Selecting by n +#> gls n +#> 1 =add 46 +#> 2 ¬an1 34 +#> 3 an 49 +#> 4 cvb(pf) 63 +#> 5 pst 28 +#> 6 pst(aor) 74

Here with the filter() function we remove all empty glosses, then we calculate and sort them according to frequency, and in the end we take top six glosses with the top_n() function. We can even visualis it with the ggplot2 package:

-df %>% 
-  filter(gls != "") %>% 
-  count(gls) %>% 
-  top_n(11) %>% 
-  ggplot(aes(n, fct_reorder(gls, n)))+
-  geom_col()+
-  labs(x = "count", y = "gloss")
-#> Selecting by n
+df %>% + filter(gls != "") %>% + count(gls) %>% + top_n(11) %>% + ggplot(aes(n, fct_reorder(gls, n)))+ + geom_col()+ + labs(x = "count", y = "gloss") +#> Selecting by n

@@ -319,7 +318,7 @@

.flextext format

-

Site built with pkgdown 2.0.3.

+

Site built with pkgdown 2.0.6.

diff --git a/docs/articles/index.html b/docs/articles/index.html index 3da0174..44facea 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -82,7 +82,7 @@

All vignettes

-

Site built with pkgdown 2.0.3.

+

Site built with pkgdown 2.0.6.

diff --git a/docs/articles/phonfieldwork.html b/docs/articles/phonfieldwork.html index 6fd6795..38536fe 100644 --- a/docs/articles/phonfieldwork.html +++ b/docs/articles/phonfieldwork.html @@ -90,7 +90,7 @@

G. Moroz,

-

2022-05-09

+

2022-09-23

Source:
vignettes/phonfieldwork.Rmd @@ -139,14 +139,14 @@

Install the package
-install.packages("phonfieldwork")
+install.packages("phonfieldwork")

This command will install the last stable version of the phonfieldwork package from CRAN. Since CRAN runs multiple package checks before making it available, this is the safest option. Alternatively, you can download the development version from GitHub:

-install.packages("remotes")
-remotes::install_github("ropensci/phonfieldwork")
+install.packages("remotes") +remotes::install_github("ropensci/phonfieldwork")

If you have any trouble installing the package, you will not be able to use its functionality. In that case you can create an issue on Github or send an email. Since this package could completely destroy @@ -154,32 +154,32 @@

Install the packagelibrary() command to load the package:

-library("phonfieldwork")
+library("phonfieldwork")

In order to work with some rmarkdown functions you will need to install pandoc, see vignette("pandoc") for the details.

This tutorial was made using the following version of phonfieldwork:

-packageVersion("phonfieldwork")
-
## [1] '0.0.12'
+packageVersion("phonfieldwork") +
## [1] '0.0.11'

This tutorial can be cited as follows:

-citation("phonfieldwork")
-
## 
-## To cite package 'phonfieldwork' in publications use:
-## 
-##   Moroz G (2020). _Phonetic fieldwork and experiments with phonfieldwork package_.
-##   <https://CRAN.R-project.org/package=phonfieldwork>.
-## 
-## A BibTeX entry for LaTeX users is
-## 
-##   @Manual{,
-##     title = {Phonetic fieldwork and experiments with phonfieldwork package},
-##     author = {George Moroz},
-##     year = {2020},
-##     url = {https://CRAN.R-project.org/package=phonfieldwork},
-##   }
+citation("phonfieldwork") +
## 
+## To cite package 'phonfieldwork' in publications use:
+## 
+##   Moroz G (2020). _Phonetic fieldwork and experiments with phonfieldwork package_.
+##   <https://CRAN.R-project.org/package=phonfieldwork>.
+## 
+## A BibTeX entry for LaTeX users is
+## 
+##   @Manual{,
+##     title = {Phonetic fieldwork and experiments with phonfieldwork package},
+##     author = {George Moroz},
+##     year = {2020},
+##     url = {https://CRAN.R-project.org/package=phonfieldwork},
+##   }

If you have any trouble using the package, do not hesitate to create an issue on Github.

@@ -259,19 +259,19 @@

Make a list of your stimuli
-my_stimuli <- c("tip", "tap", "top")
+my_stimuli <- c("tip", "tap", "top")
-my_stimuli_df <- read.csv("my_stimuli_df.csv")
-my_stimuli_df
-
##   stimuli vowel
-## 1     tip     ı
-## 2     tap     æ
-## 3     top     ɒ
+my_stimuli_df <- read.csv("my_stimuli_df.csv") +my_stimuli_df +
##   stimuli vowel
+## 1     tip     ı
+## 2     tap     æ
+## 3     top     ɒ