텍스트와 이모티콘이 모두 포함 된 Facebook의 의견 세트 (Sprinkr와 같은 시스템을 통해 가져옴)가 있으며, R에서 다양한 분석을 실행하려고합니다. 이모티콘 문자를 정확하게 섭취하는 것이 어려워졌습니다.유니 코드 이모티콘을 R에 정확하게 입력하십시오.
예를 들어 :!?!?! 나는이 같은 것을 포함하는 메시지를 줄 것이다 (에 UTF-8 인코딩)를 .csv 있습니다
"이 올바른지를 그것이 사실이 아니라는 말 해주세요 내가 다른 소스에서 이해하는 것과,
library(tidyverse)
library(janitor)
raw.fb.comments <- read_csv("data.csv",
locale = locale(encoding="UTF-8"))
fb.comments <- raw.fb.comments %>%
clean_names() %>%
filter(senderscreenname != "Reese's") %>%
select(c(message,messagetype,sentiment)) %>%
mutate(type = "Facebook")
fb.comments$message[5]
[1] "IS THIS CORRECT!?!?! Please say it isn't true!!! Our family only eats the original Reeses Peanut Butter Cups\xf0\u009f\u0092\u009a\xf0\u009f\u0092\u009a\xf0\u009f\u0092\u009a\n\n"
지금, 나는 변환해야합니다! 우리 가족은 원래 Reeses 땅콩 버터 컵 "
이그때 다음과 같은 방법으로 R로 섭취를 먹고 이 UTF-8을 ASCII로 변환 한 다음 다른 이모티콘 리소스와 연결하는 데 사용할 수 있습니다 (l 멋진 이케 emojidictionary). 조인 작업을하려면, 내가 R-인코딩이 같은이 점을 얻을 필요가 : 정상적인 단계를 추가,
<e2><9d><a4><ef><b8><8f>
그러나 (iconv
사용)이 저를하지 않습니다
fb.comments <- raw.fb.comments %>%
clean_names() %>%
filter(senderscreenname != "Reese's") %>%
select(c(message,messagetype,sentiment)) %>%
mutate(type = "Facebook") %>%
mutate(message = iconv(message, from="UTF-8", to="ascii",sub="byte"))
fb.comments$message[5]
[1] "IS THIS CORRECT!?!?! Please say it isn't true!!! Our family only eats the original Reeses Peanut Butter Cups<f0><9f><92><9a><f0><9f><92><9a><f0><9f><92><9a>\n\n"
내가 누락 된 부분을 밝히는 사람이 있습니까? 아니면 다른 이모티콘 매핑 리소스를 찾아야합니까? 감사!
'dput (fb.comments $ message [5]) '를 표시 할 수 있습니까? –
'''dput (fb.comments의 $ 메시지 [5]) 을 "이 올바른지!?!?! 그것이 사실이 아니라는 말 해주세요! 우리 가족은 원래 Reeses 땅콩 버터 컵을 먹는<9f><92><9a><9f><92><9a> 0><9f><9a> \ n ""'' –
그리고 mutate-iconv? –