# R/pickIPA.R In phonTools: Tools for Phonetic and Acoustic Analyses

```# Copyright (c) 2015 Santiago Barreda

pickIPA = function (vowels, n = 0, xsampa = FALSE, description = FALSE, verify = TRUE){
if (missing(vowels) & n == 0) stop ('Please provide either a vowels vector or the number of vowels to select.')
vector = FALSE
if (!missing(vowels)) vector = TRUE
if (vector){
vowels = as.factor (vowels)
vtypes = levels(vowels)
nvowels = ntypes (vowels)
n = nvowels
}
IPA = ipainfo()[c(1,4,2,5)]
plot (IPA[]\$frontness+(IPA[]\$rounded*.25), IPA[]\$height, pch = IPA[],cex = 2,
col = 1+IPA[]\$rounded*3, xlab = '',ylab = '', xaxt = 'n', yaxt = 'n',xlim = c(.75,3.5),
ylim=c(0.75,4.25))
axis (side = 1, at = c(1.15,2.15,3.15), c('Front','Mid','Back'), cex.axis = 1.3)
axis (side = 2, at = c(1,2,3,4), c('open','open-mid','close-mid','close'), cex.axis = 1.3)

selected = rep(0,n)
for (i in 1:n){
if (vector) cat ('Please select ->  ', vtypes[i], '\n\n')
if (!vector) cat ('Please select vowel ', i, '\n\n')
flush.console()
selected[i] = identify (IPA[]\$frontness+(IPA[]\$rounded*.25), IPA[]\$height,'', n = 1)
}

if (verify == TRUE) plot (1:n, rep(1,n), pch = IPA[][selected], ylab='',yaxt='n', xlab='Selection',cex = 2)
if (vector == TRUE) selected = selected[as.numeric(vowels)]
out = list (IPA = IPA[][selected])
if (xsampa == TRUE) out\$xsampa = IPA[][selected]
if (description == TRUE) out\$description = IPA[][selected]
out
}
```

## Try the phonTools package in your browser

Any scripts or data that you put into this service are public.

phonTools documentation built on May 1, 2019, 6:26 p.m.
{"ft_lang_label":"__label__en","ft_lang_prob":0.61198795,"math_prob":0.99802816,"size":1591,"snap":"2023-14-2023-23","text_gpt3_token_len":563,"char_repetition_ratio":0.13925646,"word_repetition_ratio":0.0,"special_character_ratio":0.39912006,"punctuation_ratio":0.2140845,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9942228,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-09T15:37:25Z\",\"WARC-Record-ID\":\"<urn:uuid:1fd3c93e-83c7-49b3-8357-646027e44e62>\",\"Content-Length\":\"46429\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:accbd619-2477-4f57-aceb-f13da892ecff>\",\"WARC-Concurrent-To\":\"<urn:uuid:ebd8d9e6-21d7-4f00-a48c-bf037c94fa58>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/phonTools/src/R/pickIPA.R\",\"WARC-Payload-Digest\":\"sha1:OGOTFIT6Z3BTCBKPHLG6CHPPZUGY7SIJ\",\"WARC-Block-Digest\":\"sha1:JANJQSD3MKDHLFG6RX5TECNVBXWIFLXW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224656737.96_warc_CC-MAIN-20230609132648-20230609162648-00436.warc.gz\"}"}