當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


R stringr stringr-data 用於練習字符串操作的示例字符向量

fruitwords來自Gabor Csardi編寫的rcorpora包;該數據由 Darius Kazemi 收集並在 https://github.com/dariusk/corpora 上提供。 sentences是"Harvard sentences"的集合,用於語音標準化測試。

用法

sentences

fruit

words

格式

字符向量。

例子

length(sentences)
#> [1] 720
sentences[1:5]
#> [1] "The birch canoe slid on the smooth planks." 
#> [2] "Glue the sheet to the dark blue background."
#> [3] "It's easy to tell the depth of a well."     
#> [4] "These days a chicken leg is a rare dish."   
#> [5] "Rice is often served in round bowls."       

length(fruit)
#> [1] 80
fruit[1:5]
#> [1] "apple"       "apricot"     "avocado"     "banana"      "bell pepper"

length(words)
#> [1] 980
words[1:5]
#> [1] "a"        "able"     "about"    "absolute" "accept"  
源代碼:R/data.R

相關用法


注:本文由純淨天空篩選整理自Hadley Wickham等大神的英文原創作品 Sample character vectors for practicing string manipulations。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。