Learn R Programming

rPraat package for R

rPraat package for R constitutes an interface between the most popular software for phonetic analyses, Praat, and R.

Version 1.3.2-1

For demonstration, see html/rDemo.html

Package documentation https://github.com/bbTomas/rPraat/blob/master/rPraat.pdf

CRAN link: https://CRAN.R-project.org/package=rPraat

See also: mPraat toolbox for Matlab.

rPraat and mPraat homepage: https://fu.ff.cuni.cz/praat/

Installation

One-time installation (internet connection needed).

CRAN: official version

install.packages("rPraat")

GitHub: experimental, most recent version

install.packages("devtools")
devtools::install_github("bbTomas/rPraat")

Initialize and Test

At each R session, you have to initialize the package (no internet needed).

library(rPraat)
library(dplyr)   # optional, if you want to use the pipeline operator %>%

tg.sample() %>% tg.plot()  # demo test

How to cite this package?

We have invested a lot of time and effort in creating mPraat toolbox / rPraat package, please cite it when using it for data analysis.

Bořil, T., & Skarnitzl, R. (2016). Tools rPraat and mPraat. In P. Sojka, A. Horák, I. Kopeček, & K. Pala (Eds.), Text, Speech, and Dialogue (pp. 367–374). Springer International Publishing.

Download Tools rPraat and mPraat manuscript .pdf

The final publication is available at Springer via DOI 10.1007/978-3-319-45510-5_42

Download BibTeX reference mpraatrpraat2016.bib

What is new

v1.3.2-1 (2021/02/27): pitch.read(), formant.read() fix to new Praat text formats

v1.3.2 (2021/01/28): pt., it., pitch., formant., snd. getPointIndexHigherThanTime(), getPointIndexLowerThanTime(), getPointIndexNearestTime()

v1.3.1-1 (2020/04/04): formant.read(), formant.write(), pitch.read(), pitch.write(): better handling of –undefined– values

v1.3.1 (2020/04/04): tg.plot(): can plot formant and pitch objects in frame and array formats

v1.3 (2019/12/04): tg.boundaryMagnet(): align interval boundaries in a target tier according to a pattern tier

v1.2.0-3 (2019/04/27): if “UTF-8” encoding is specified in .read() functions (i.e., default value) and input file cannot be read properly, then “auto” encoding is tried automatically with a warning message notification

v1.2.0-2 (2019/04/01): “UTF-16” TextGrids are properly saved in “UTF-8”

v1.2.0-1 (2019/03/16): detectEncoding(): removed “UTF-16LE” (does not work anymore), tg.read(fileName, encoding = “auto”) works again

v1.2.0 (2018/12/08): pitch.write(), formant.write(), col.write()

v1.1.4 (2018/12/08): pitch.cut(), formant.cut(), snd.cut(); pitch.cut0(), formant.cut0(), snd.cut0()

v1.1.3-4 (2018/12/03): snd.read(), snd.write(), snd.plot(), as.snd(); tg.plot() can plot TextGrid together with Sound object; it.plot() can plot IntensityTier together with Sound object

v1.1.3-3 (2018/12/03): formant.toFrame(), pitch.toArray(), pitch.toFrame(), pitch.plot(); tg.plot() can plot TextGrid together with Pitch object; pitch.plot() can plot Pitch object together with PitchTier

v1.1.3-2 (2018/10/29): formant.plot(), formant.toArray(); tg.plot() can plot TextGrid together with Formant object

v1.1.3-1 (2018/10/26): tg.plot() can plot TextGrid together with PitchTier and IntensityTier in one plot

v1.1.3 (2018/10/20): formant.read(), formant.sample(), as.formant(); col.read() can read formant objects

v1.1.2-1 (2018/10/20): tg.plot(): right-aligned labels; pitch.sample(), as.tg(), as.pt(), as.it(), as.pitch(); .read(), .sample() and tg.createNewTextGrid(): class(object)[“type”] set to “TextGrid”, “PitchTier” etc. and class(object)[“name”] set according to fileName

v1.1.2 (2018/08/04): tg.cut(), tg.cut0()

v1.1.1 (2018/08/02): IntensityTiers: it.read(), it.write(), it.plot(), it.sample(), it.interpolate(), it.cut(), it.cut0(), it.legendre(), it.legendreDemo(), it.legendreSynth(), col.read() supports IntensityTiers

v1.1.0 (2018/08/01): col.read() to read Collection in Text and Short-text format (Collection may store many objects in one file – TextGrids, PitchTiers, Pitch objects). Big thanks to Pol van Rijn for initiating this and making the major portion of the new code in mPraat toolbox. Supports for file encodings in all read functions (thanks to Weirong Chen for his DetectEncoding idea in mPraat toolbox).

v1.0.8-3 (2017/11/27): tg.write(): fix for possible UTF-8 encoding and Windows OS locale mismatch

v1.0.8-2 (2017/11/04): tg.write() and pt.write() format support: “text” (full text format), “short” (short text format), and in addition for pt: “spreadsheet” and “headerless”; tg.read(), pt.read() and pitch.read(): optional file encoding parameter (default: “UTF-8”)

v1.0.8-1 (2017/09/01): bugfix, short-text TextGrid with multiple lines in a label no longer produces “missing sppasFormat variable” error

v1.0.8 (2017/07/16): pitch.read() to read Pitch-object files with time frames of pitch candidates

v1.0.7 (2017/04/19): tg.findLabels(), tg.duplicateTierMergeSegments()

v1.0.6 (2017/04/11): pt.cut(), pt.cut0()

v1.0.5 (2017/04/10): pt.legendre(), pt.legendreSynth(), pt.legendreDemo()

v1.0.4 (2017/03/06): pt.interpolate(), pt.Hz2ST()

License

License: MIT

Copyright (c) 2016 Tomáš Bořil, borilt@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copy Link

Version

Install

install.packages('rPraat')

Monthly Downloads

319

Version

1.3.2-1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Tomas Boril

Last Published

February 27th, 2021

Functions in rPraat (1.3.2-1)

formant.cut

formant.cut
as.formant

as.formant
as.snd

as.snd
col.read

col.read
detectEncoding

detectEncoding
as.pitch

as.pitch
col.write

col.write
as.tg

as.tg
as.it

as.it
formant.sample

formant.sample
it.cut0

it.cut0
formant.getPointIndexLowerThanTime

formant.getPointIndexLowerThanTime
it.write

it.write
pitch.write

pitch.write
as.pt

as.pt
formant.getPointIndexNearestTime

formant.getPointIndexNearestTime
it.sample

it.sample
it.plot

it.plot
it.getPointIndexHigherThanTime

it.getPointIndexHigherThanTime
pt.Hz2ST

pt.Hz2ST
formant.toArray

formant.toArray
formant.plot

formant.plot
pt.cut

pt.cut
isString

isString
it.cut

it.cut
pitch.getPointIndexHigherThanTime

pitch.getPointIndexHigherThanTime
pitch.getPointIndexLowerThanTime

pitch.getPointIndexLowerThanTime
pitch.cut

pitch.cut
pitch.cut0

pitch.cut0
pt.interpolate

pt.interpolate
pt.getPointIndexNearestTime

pt.getPointIndexNearestTime
formant.read

formant.read
pt.cut0

pt.cut0
ifft

ifft
pitch.toArray

pitch.toArray
pt.read

pt.read
pt.getPointIndexHigherThanTime

pt.getPointIndexHigherThanTime
it.read

it.read
pitch.toFrame

pitch.toFrame
pt.sample

pt.sample
pt.getPointIndexLowerThanTime

pt.getPointIndexLowerThanTime
isInt

isInt
it.interpolate

it.interpolate
it.legendre

it.legendre
pitch.getPointIndexNearestTime

pitch.getPointIndexNearestTime
pitch.plot

pitch.plot
pt.legendreSynth

pt.legendreSynth
seqM

seqM
tg.countLabels

tg.countLabels
snd.write

snd.write
snd.sample

snd.sample
snd.cut

snd.cut
str_find

str_find
str_find1

str_find1
pt.plot

pt.plot
pt.write

pt.write
formant.toFrame

formant.toFrame
formant.write

formant.write
snd.plot

snd.plot
tg.cut

tg.cut
tg.getPointIndexHigherThanTime

tg.getPointIndexHigherThanTime
snd.read

snd.read
tg.cut0

tg.cut0
tg.getPointIndexLowerThanTime

tg.getPointIndexLowerThanTime
round2

round2
formant.cut0

formant.cut0
formant.getPointIndexHigherThanTime

formant.getPointIndexHigherThanTime
it.getPointIndexNearestTime

it.getPointIndexNearestTime
it.getPointIndexLowerThanTime

it.getPointIndexLowerThanTime
tg.boundaryMagnet

tg.boundaryMagnet
tg.insertBoundary

tg.insertBoundary
tg.sample

tg.sample
tg.sampleProblem

tg.sampleProblem
tg.getTotalDuration

tg.getTotalDuration
tg.getPointIndexNearestTime

tg.getPointIndexNearestTime
it.legendreDemo

it.legendreDemo
tg.checkTierInd

tg.checkTierInd
tg.duplicateTier

tg.duplicateTier
isLogical

isLogical
pitch.read

pitch.read
pitch.sample

pitch.sample
isNum

isNum
tg.createNewTextGrid

tg.createNewTextGrid
tg.getNumberOfTiers

tg.getNumberOfTiers
tg.plot

tg.plot
tg.getNumberOfPoints

tg.getNumberOfPoints
tg.insertInterval

tg.insertInterval
tg.duplicateTierMergeSegments

tg.duplicateTierMergeSegments
pt.legendre

pt.legendre
snd.getPointIndexLowerThanTime

snd.getPointIndexLowerThanTime
pt.legendreDemo

pt.legendreDemo
tg.removeIntervalLeftBoundary

tg.removeIntervalLeftBoundary
tg.insertNewIntervalTier

tg.insertNewIntervalTier
tg.removeIntervalBothBoundaries

tg.removeIntervalBothBoundaries
tg.getPointTime

tg.getPointTime
it.legendreSynth

it.legendreSynth
tg.getTierName

tg.getTierName
tg.getStartTime

tg.getStartTime
snd.cut0

snd.cut0
snd.getPointIndexHigherThanTime

snd.getPointIndexHigherThanTime
tg.getEndTime

tg.getEndTime
tg.findLabels

tg.findLabels
tg.getLabel

tg.getLabel
snd.getPointIndexNearestTime

snd.getPointIndexNearestTime
tg.write

tg.write
tg.removeTier

tg.removeTier
tg.repairContinuity

tg.repairContinuity
strTrim

strTrim
str_contains

str_contains
tg.isPointTier

tg.isPointTier
tg.isIntervalTier

tg.isIntervalTier
tg.removeIntervalRightBoundary

tg.removeIntervalRightBoundary
tg.getNumberOfIntervals

tg.getNumberOfIntervals
tg.removePoint

tg.removePoint
tg.read

tg.read
tg.setLabel

tg.setLabel
tg.setTierName

tg.setTierName
tg.getIntervalDuration

tg.getIntervalDuration
tg.getIntervalEndTime

tg.getIntervalEndTime
tg.insertNewPointTier

tg.insertNewPointTier
tg.getIntervalIndexAtTime

tg.getIntervalIndexAtTime
tg.insertPoint

tg.insertPoint
tg.getIntervalStartTime

tg.getIntervalStartTime