gpt4 book ai didi

r - 如何在 R 中使用 stringr 检测 ¹?

转载 作者:行者123 更新时间:2023-12-05 01:22:09 24 4
gpt4 key购买 nike

<分区>

我想在 R 中使用 stringr 检测字符串中的 ¹² 等。

稍后我将从句子中提取它(如 text¹ text, 2020)

library(stringr)

str_detect("¹", "[:digit:]")
#> [1] FALSE
str_detect("¹", "[:alpha:]")
#> [1] FALSE
str_detect("¹", "[:punct:]")
#> [1] FALSE

创建于 2022-11-19 reprex v2.0.2

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