如何删除R中包含特殊字符的行

问题描述 投票:0回答:1

summary(housingdata$City)

输出--->阿姆斯特丹阿姆斯特丹-祖多斯特·贝伦

         14791                167                  1 
        Berlin     爱ä¸\u0081å ¡  ì—\u0090ë“ ë²„ëŸ¬ 
         13641                  4                  1 
            NA             Others          Stockholm 
             0               8231                692 
          NA's 
            46 

我尝试了以下代码,但它们似乎不起作用:

housingdata$City[housingdata$City == 'NA'] <- NA
housingdata$City[housingdata$City == '爱ä¸\u0081å'] <- NA
housingdata$City[housingdata$City == 'BerlÃn'] <- NA
housingdata$City[housingdata$City == 'ì—\u0090ë“ ë²„ëŸ¬'] <- NA
r string dplyr delete-row mutate
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.