나는 다음과 같은 트윗이 실제로 아래의 문자열을 반환하도록 (중복 트윗을 제거하기 위해) R에서 단어로 시작하는 문장을 제거 하시겠습니까?
"RT @SportClipsUT125: #SavingLivesLooksGood with #RedCross. Donate this month & Get free haircut cpn. https://somewebsite https://somewebsite…"
어떻게 모든 링크를 제거 할 수 있습니다 R.
에서이 같은 트윗 텍스트가?"RT @SportClipsUT125: #SavingLivesLooksGood with #RedCross. Donate this month & Get free haircut"
나는이 시도 :
gsub('https*','',test_str)
을하지만 간단한 해결책을 변경하여 GSUB 명령입니다
"RT @SportClipsUT125: #SavingLivesLooksGood with #RedCross. Donate this
month & Get free haircut cpn. ://somewebsite ://somewebsite…"
당신은 당신이 반복하려는 문자에 한정 기호를 넣어해야합니다. '\\ S'는 공백 문자 이외의 것입니다 :'gsub ('http \\ S *', '', RT @ SportClipsUT125 : #SavingLivesLooksGoodRedCross.이 달에 기부하기 & 헤어 스타일 cpn 가져 오기 .https : // somewebsite https : // somewebsite ... ")' – alistaire
아마도 -RT가 붙은 (대소 문자 구분) 동일한 쿼리를 twitter에 다시 보낼 수 있습니다. 이렇게하면 리트 윗이 제거됩니다. – knb
감사합니다 @alistaire이 실제로 작동합니다! 그래서 코드가하는 일은 실제로 https와 공간 뒤에있는 모든 것을 제거하는 것입니까? –