[英]Compare two data frames to identify typos in R
我有兩個單列數據框:一個包含數字,另一個實際上是第一個手動鍵入的數據,因此存在鍵入錯誤。 我想檢查第二個數據框中的拼寫錯誤。
例如:
Df1 Df2
col1 col1
11111 11111 --> Correct. Same as in df1.
01234 01233 --> last digit should be 4, not 3.
11111 12111 --> second digit is 1, not 2.
56789 56799 --> second last digit should be 8, not 9.
我想識別R中數據框2中有錯字的行。我擁有的真實數據集的數字中可能有多個錯字,但是現在查找具有一個錯字的數字會很好。 請提出解決方案。
我有兩個單列數據框:一個包含數字,另一個實際上是第一個手動鍵入的數據,因此存在鍵入錯誤。 我想檢查第二個數據框中的拼寫錯誤。
例如:
Df1 Df2
col1 col1
11111 11111 --> Correct. Same as in df1.
01234 01233 --> last digit should be 4, not 3.
11111 12111 --> second digit is 1, not 2.
56789 56799 --> second last digit should be 8, not 9.
我想識別R中數據框2中有錯字的行。我擁有的真實數據集的數字中可能有多個錯字,但是現在查找具有一個錯字的數字會很好。 請提出解決方案。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.