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 @@
Когда колючка воткнулась, [он] ушел к Бихтаю.
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 @@Три дня не ели, мы с ней не зная, сказал он.
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 @@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 @@
-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 @@ 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 @@vignettes/phonfieldwork.Rmd
phonfieldwork.Rmd
-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 @@
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 @@
-my_stimuli <- c("tip", "tap", "top")
+my_stimuli <- c("tip", "tap", "top")
.csv
file and read it into R using the
read.csv()
function:
-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 ɒ
.xls
or xlsx
file and read it into R using the
@@ -282,16 +282,16 @@
-library("readxl")
-# run install.packages("readxl") in case you don't have it installed
-my_stimuli_df <- read_xlsx("my_stimuli_df.xlsx")
-my_stimuli_df
-## # A tibble: 3 × 2
-## stimuli vowel
-## <chr> <chr>
-## 1 tip ı
-## 2 tap æ
-## 3 top ɒ
+library("readxl")
+# run install.packages("readxl") in case you don't have it installed
+my_stimuli_df <- read_xlsx("my_stimuli_df.xlsx")
+my_stimuli_df
+## # A tibble: 3 × 2
+## stimuli vowel
+## <chr> <chr>
+## 1 tip ı
+## 2 tap æ
+## 3 top ɒ
setwd()
) does not change your working
directory.
-create_presentation(stimuli = my_stimuli_df$stimuli,
- output_file = "first_example",
- output_dir = getwd())
create_presentation(stimuli = my_stimuli_df$stimuli,
+ output_file = "first_example",
+ output_dir = getwd())
As a result, a file “first_example.html” was created in the output
folder. You can change the name of this file by changing the
output_file
argument. The .html
file now looks
@@ -331,14 +331,14 @@
external
argument, which of the stimuli is
external:
-my_image <- system.file("extdata", "r-logo.png", package = "phonfieldwork")
-my_image
## [1] "/home/agricolamz/R/x86_64-pc-linux-gnu-library/4.2/phonfieldwork/extdata/r-logo.png"
+my_image <- system.file("extdata", "r-logo.png", package = "phonfieldwork")
+my_image
+## [1] "/home/agricolamz/R/x86_64-pc-linux-gnu-library/4.2/phonfieldwork/extdata/r-logo.png"
-create_presentation(stimuli = c("rzeka", "drzewo", my_image),
- external = 3,
- output_file = "second_example",
- output_dir = getwd())
create_presentation(stimuli = c("rzeka", "drzewo", my_image),
+ external = 3,
+ output_file = "second_example",
+ output_dir = getwd())