gpt4 book ai didi

R 的 toTitleCase() 对 word "all"不起作用

转载 作者:行者123 更新时间:2023-12-04 10:45:11 25 4
gpt4 key购买 nike

出于某种原因,R 的 toTitleCase()函数不适用于“all”这个词。任何想法为什么?

library(tools)
toTitleCase("all") # gives "all"
toTitleCase("alt") # gives "Alt"

最佳答案

帮助页面中的详细信息部分 ?toTitleCase注意到

Generally words in all capitals are left alone: this implementation knows about conventional mixed-case words such as ‘LaTeX’ and ‘OpenBUGS’ and a few technical terms which are not usually capitalized such as ‘jar’ and ‘xls’.



类型 toTitleCase没有括号进入您的控制台。您将看到一组异常(exception)词以及一个用于连接词的冗长正则表达式。其中有
either <- c("all", "above", "after", "along", "also", "among", 
"any", "both", "can", "few", "it", "less", "log", "many",
"may", "more", "over", "some", "their", "then", "this",
"under", "until", "using", "von", "when", "where", "which",
"will", "without", "yet", "you", "your")

其中包含“所有”。

关于R 的 toTitleCase() 对 word "all"不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44639101/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com