【发布时间】:2021-10-07 05:09:09
【问题描述】:
我在一个 xlsx 文件中有数千行,我想删除所有超过 5 个句点的行(每一行都是数字、字母和句点的组合)。
我在 Excel 中的 3 行示例:
2a02.587.e815.cb8d.35bf.5c99.8d51.417b
2a02.587.e815.727
3a03.5c99.8d51.417b.5212e
我使用了以下代码,但它返回错误:
library(tidyverse)
df1 %>%
filter(str_count("[.]") >=5)
【问题讨论】:
-
我对这个问题有似曾相识的感觉......
-
至少这次他提供了样本数据
标签: r string filtering stringr