You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: R/ec_tile_map.R
+49-5Lines changed: 49 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,10 @@
7
7
#' @param annotate_feature Logical variable that specifies, whether to add feature values on the tile. This especially make sense in case of numeric features. Default value is \code{FALSE}.
8
8
#' @param abbreviation Logical variable that specifies, whether use abbreviations for languages specified in the package. Default value is \code{TRUE}.
9
9
#' @param hide_languages Character variable that specifies, which languages should be removed from the template.
10
+
#' @param rename_languages This variable maps old language names to their corresponding new names. It can be represented as either:
11
+
#' \itemize{
12
+
#' \item{A named vector, where names are the old language names and values are the corresponding new language names.}
13
+
#' \item{A data frame with two columns: \code{language} (the old language names) and \code{new_language_name} (the corresponding new language names).}}
"The argument 'rename_languages' should be either a named character vector with languages as a name or dataframe with columns 'language' and 'new_language_name', see 'ec_languages$language' for the possible values"=
"The argument 'rename_languages' should be either a named character vector with languages as a name or dataframe with columns 'language' and 'new_language_name', see 'ec_languages$language' for the possible values"=
82
+
"language"%in% colnames(rename_languages),
83
+
"The argument 'rename_languages' should be either a named character vector with languages as a name or dataframe with columns 'language' and 'new_language_name', see 'ec_languages$language' for the possible values"=
<h2data-number="6" class="anchored" data-anchor-id="changing-the-language-template"><spanclass="header-section-number">6</span> Changing the language template</h2>
402
402
<p>The East Caucasian language family exhibits significant dialectal differentiation. A unified genealogical classification of all idioms spoken in Daghestan does not exist. The default language inventory in <code>RCaucTile</code> is based on the genealogical classification from the Typological Atlas of the Languages of Daghestan (see <ahref="https://lingconlab.ru/tald/languages.html">the languages page</a>). Therefore, it is highly probable that some researchers may wish to modify the default inventory by removing or altering the names of existing units.</p>
403
-
<p>To remove specific languages from the template, list the desired languages in the <code>remove_languages</code> argument.</p>
403
+
<p>To remove specific languages from the template, list the desired languages in the <code>hide_languages</code> argument.</p>
404
404
<divclass="cell">
405
405
<divclass="sourceCode cell-code" id="cb25"><preclass="sourceCode r code-with-copy"><codeclass="sourceCode r"><spanid="cb25-1"><ahref="#cb25-1" aria-hidden="true" tabindex="-1"></a><spanclass="fu">ec_tile_map</span>(ec_languages,</span>
<p>In order to change the names of existing languages in the template, you need …</p>
417
+
<p>In order to change the names of existing languages in the template, you need to provide the <code>rename_languages</code> argument with an object that maps old language names to their corresponding new names. This can be represented as either:</p>
418
+
<ul>
419
+
<li>A named vector, where the names are the old language names and the values are the corresponding new language names.</li>
420
+
</ul>
421
+
<divclass="cell">
422
+
<divclass="sourceCode cell-code" id="cb26"><preclass="sourceCode r code-with-copy"><codeclass="sourceCode r"><spanid="cb26-1"><ahref="#cb26-1" aria-hidden="true" tabindex="-1"></a>new_language_names <spanclass="ot"><-</span><spanclass="fu">c</span>(<spanclass="st">"Upper Andi"</span><spanclass="ot">=</span><spanclass="st">"Andi"</span>,</span>
<li>A data frame with two columns: <code>language</code> (the old language names) and <code>new_language_name</code> (the corresponding new language names).</li>
Copy file name to clipboardExpand all lines: docs/index.qmd
+32-1Lines changed: 32 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -205,4 +205,35 @@ ec_tile_map(ec_languages,
205
205
hide_languages = c("Gigatli", "Shari"))
206
206
```
207
207
208
-
In order to change the names of existing languages in the template, you need ...
208
+
In order to change the names of existing languages in the template, you need to provide the `rename_languages` argument with an object that maps old language names to their corresponding new names. This can be represented as either:
209
+
210
+
- A named vector, where the names are the old language names and the values are the corresponding new language names.
211
+
212
+
```{r}
213
+
new_language_names <- c("Upper Andi" = "Andi",
214
+
"Northern Akhvakh" = "Akhvakh")
215
+
216
+
ec_tile_map(ec_languages,
217
+
feature_column = "morning_greetings",
218
+
title = "Morning greetings (Naccarato, Verhees 2021)",
0 commit comments