我有一個數據表與同一列中的.txt鏈接列表。我正在尋找一種方法讓R在每個鏈接中搜索文件是否包含折扣率或折扣現金流。然後,我要R在每個鏈接旁邊創建2列(一個用於折扣率,另一個用於折扣現金流),如果存在,那麼其中將有1個,如果不存在則爲0。如何在一列鏈接中查找r中的字符串匹配?
這裏的示例鏈接的小單子,我想通過篩選:
http://www.sec.gov/Archives/edgar/data/1015328/0000913849-04-000510.txt
http://www.sec.gov/Archives/edgar/data/1460306/0001460306-09-000001.txt
http://www.sec.gov/Archives/edgar/data/1063761/0001047469-04-028294.txt
http://www.sec.gov/Archives/edgar/data/1230588/0001178913-09-000260.txt
http://www.sec.gov/Archives/edgar/data/1288246/0001193125-04-155851.txt
http://www.sec.gov/Archives/edgar/data/1436866/0001172661-09-000349.txt
http://www.sec.gov/Archives/edgar/data/1089044/0001047469-04-026535.txt
http://www.sec.gov/Archives/edgar/data/1274057/0001047469-04-023386.txt
http://www.sec.gov/Archives/edgar/data/1300379/0001047469-04-026642.txt
http://www.sec.gov/Archives/edgar/data/1402440/0001225208-09-007496.txt
http://www.sec.gov/Archives/edgar/data/35527/0001193125-04-161618.txt
'dput()'> imgs – hrbrmstr