Closed shua0818 closed 2 years ago
안녕하세요, 텍스트마이닝 예제 연습하다가 문제가 있어서 질문 드립니다. p.268 에서 txt 파일 불러오기까지 실행하면 한글이 잘 나오는데
txt <- readLines("hiphop.txt") head(txt)
아래 특수문자 제거 코드를 실행하면 한글이 다 깨져버립니다.
install.packages("stringr") library(stringr) txt <- str_replace_all(txt, "\\W", " ")
R Studio 인코딩은 UTF-8로 설정해두었구요. txt 파일 문제인가 싶어 파일 인코딩 바꿔가면서 시도해봤는데 해결되지 않습니다. 무엇이 문제일까요..?ㅠㅠ
해결했습니다!
해결하셨다니 다행입니다. 어떤 방법으로 해결하셨는지 알려주시겠어요?
안녕하세요, 텍스트마이닝 예제 연습하다가 문제가 있어서 질문 드립니다. p.268 에서 txt 파일 불러오기까지 실행하면 한글이 잘 나오는데
아래 특수문자 제거 코드를 실행하면 한글이 다 깨져버립니다.
R Studio 인코딩은 UTF-8로 설정해두었구요. txt 파일 문제인가 싶어 파일 인코딩 바꿔가면서 시도해봤는데 해결되지 않습니다. 무엇이 문제일까요..?ㅠㅠ