트위터 트렌드

R로 소셜 미디어 데이터 분석하기

Vivek Vijayaraghavan

Data Science Coach

학습 개요

  • 트위터 트렌드 이해하기
  • 트렌딩 토픽 추출하기
  • 참여와 참여도 향상을 위해 트렌드 활용하기
R로 소셜 미디어 데이터 분석하기

트위터 트렌드는 무엇인가요?

  • 현재 인기 있는 키워드·이벤트·주제
  • 급상승 화제를 탐색
  • 일부 트렌드는 해시태그 포함
  • 해시태그로 트렌딩 대화를 검색
  • 위치 트렌드는 특정 지역의 주제를 식별
R로 소셜 미디어 데이터 분석하기

트위터 트렌드 활용하기

  • 마케팅 메시지를 트렌딩 토픽과 결합
  • 트렌드는 트윗 참여를 높임
  • 여행 포털은 "#TravelTuesday"에 맞춰 트윗
R로 소셜 미디어 데이터 분석하기

전 세계 트렌드 추출

# Get overall current trending topics
trend_topics <- get_trends()
head(trend_topics$trend, 10)
 [1] "#madebygoogle"         "#あなたとHしたい人の数"
 [3] "西田くん"                "Jennifer Aniston"      
 [5] "#ワールドカップバレー"     "#FelizMartes"          
 [7] "#G線上のあなたと私"       "西田選手"              
 [9] "피디수첩"                "タジキスタン"
  • 특정 지역의 트렌드를 추출하는 것이 더 유의미함
R로 소셜 미디어 데이터 분석하기

트렌드 제공 지역

# Extract locations of available twitter trends
trends_avail <- trends_available()
head(trends_avail)
name                        url                          parentid    country
<chr>                      <chr>                           <int>      <chr>
Worldwide     http://where.yahooapis.com/v1/place/1            
Winnipeg      http://where.yahooapis.com/v1/place/2972    23424775    Canada
Ottawa        http://where.yahooapis.com/v1/place/3369    23424775    Canada    
Quebec        http://where.yahooapis.com/v1/place/3444    23424775    Canada    
Montreal      http://where.yahooapis.com/v1/place/3534    23424775    Canada    
Toronto       http://where.yahooapis.com/v1/place/4118    23424775    Canada
R로 소셜 미디어 데이터 분석하기

국가별 트렌딩 토픽

# Get trending topics in the US
gt_US <- get_trends("United States")
R로 소셜 미디어 데이터 분석하기

국가별 트렌딩 토픽

View(gt_US)

미국의 트렌딩 토픽

  • 음악 영상 회사는 "hashtagRockHall2020"로 프로모션을 배치할 수 있음
R로 소셜 미디어 데이터 분석하기

도시별 트렌딩 토픽

  • 특정 도시의 트렌드를 찾기
  • 해당 트렌드의 주변 트윗을 수집
# Get trending topics in New York
gt_city <- get_trends("New York")
R로 소셜 미디어 데이터 분석하기

도시별 트렌딩 토픽

head(gt_city)

trend                            url                        promoted_content
<chr>                           <chr>                             <lgl>
Lions            http://twitter.com/search?q=Lions                  NA    
Green Bay        http://twitter.com/search?q=%22Green+Bay%22        NA    
#DETvsGB         http://twitter.com/search?q=%23DETvsGB             NA    
LeBron           http://twitter.com/search?q=LeBron                 NA    
Aaron Rodgers    http://twitter.com/search?q=%22Aaron+Rodgers%22    NA    
#90DayFiance     http://twitter.com/search?q=%2390DayFiance         NA
  • 농구 굿즈를 홍보하는 업체는 이 트렌드를 활용 가능
R로 소셜 미디어 데이터 분석하기

가장 많이 트윗된 트렌드

  • tweet_volume은 해당 트렌드의 트윗 수를 나타냄
  • 일부 트렌드에만 제공됨
  • 가장 많이 트윗된 트렌드를 식별
R로 소셜 미디어 데이터 분석하기

가장 많이 트윗된 트렌드

# Aggregate trends and tweet volumes
library(dplyr)
trend_df <- gt_city %>%
              group_by(trend) %>%
              summarize(tweet_vol = mean(tweet_volume))
R로 소셜 미디어 데이터 분석하기

가장 많이 트윗된 트렌드

head(trend_df)
trend                  tweet_vol
<chr>                    <dbl>
#90DayFiance             14375            
#acefamilyisoverparty    12760            
#ascendwithme            NA            
#bbcon2019               NA            
#bookbirthday            NA            
#DemDebate               18928
R로 소셜 미디어 데이터 분석하기

가장 많이 트윗된 트렌드

# Sort data frame on descending order of tweet volumes
trend_df_sort <- arrange(trend_df, desc(tweet_vol))
R로 소셜 미디어 데이터 분석하기

가장 많이 트윗된 트렌드

# View the most tweeted trends
head(trend_df_sort)
trend              tweet_vol
<chr>               <dbl>
LeBron              298302            
Lions               267945            
Columbus Day        135014            
John Bolton         118933            
#DETvsGB            67197            
#TuesdayThoughts    63259
  • 여행사는 "Columbus Day"에 맞춰 휴가 상품을 홍보할 수 있음
R로 소셜 미디어 데이터 분석하기

연습해 봅시다!

R로 소셜 미디어 데이터 분석하기

Preparing Video For Download...