Last active
May 8, 2022 14:35
-
-
Save sergiospagnuolo/95a4efa7c3b90921e0a2aa834a5a80f5 to your computer and use it in GitHub Desktop.
análise de seguidores no Twitter - variação
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
screen_name | semana | med | var_semana | |
---|---|---|---|---|
cirogomes | 2021-11-29 | 1289939.42857143 | 0.21663569941901 | |
cirogomes | 2021-12-06 | 1292566.57142857 | 0.203664048012886 | |
cirogomes | 2021-12-13 | 1295949 | 0.261683123035605 | |
cirogomes | 2021-12-20 | 1298984.42857143 | 0.23422438471179 | |
cirogomes | 2021-12-27 | 1301667.71428571 | 0.20656796611771 | |
cirogomes | 2022-01-03 | 1304274.71428571 | 0.200281528948465 | |
cirogomes | 2022-01-10 | 1307455.28571429 | 0.243857478316079 | |
cirogomes | 2022-01-17 | 1310957.42857143 | 0.26785947446224 | |
cirogomes | 2022-01-24 | 1316434.71428571 | 0.417808053481528 | |
cirogomes | 2022-01-31 | 1320763.28571429 | 0.328810185693107 | |
cirogomes | 2022-02-07 | 1324667.71428571 | 0.295619102503819 | |
cirogomes | 2022-02-14 | 1327217.42857143 | 0.192479537186374 | |
cirogomes | 2022-02-21 | 1330337.57142857 | 0.235089050970427 | |
cirogomes | 2022-02-28 | 1334712.25 | 0.328839737024866 | |
cirogomes | 2022-03-07 | 1338181.125 | 0.259896842933749 | |
cirogomes | 2022-03-14 | 1341081.71428571 | 0.21675610509857 | |
cirogomes | 2022-03-21 | 1343616 | 0.18897325101741 | |
cirogomes | 2022-03-28 | 1346071.42857143 | 0.182747791886118 | |
cirogomes | 2022-04-04 | 1348638.42857143 | 0.190703104271694 | |
cirogomes | 2022-04-11 | 1350647 | 0.148933278632657 | |
cirogomes | 2022-04-25 | 1364651 | 1.03683641987877 | |
cirogomes | 2022-05-02 | 1370360.2 | 0.418363376423714 | |
jairbolsonaro | 2021-11-29 | 7173009.85714286 | 0.162584691038425 | |
jairbolsonaro | 2021-12-06 | 7182590.57142857 | 0.133566166456256 | |
jairbolsonaro | 2021-12-13 | 7193499.28571429 | 0.15187715598195 | |
jairbolsonaro | 2021-12-20 | 7201034 | 0.104743379910777 | |
jairbolsonaro | 2021-12-27 | 7207699.42857143 | 0.0925621038788016 | |
jairbolsonaro | 2022-01-03 | 7218806.71428571 | 0.154103064706845 | |
jairbolsonaro | 2022-01-10 | 7234184.57142857 | 0.213024918819693 | |
jairbolsonaro | 2022-01-17 | 7249335.42857143 | 0.209434207729431 | |
jairbolsonaro | 2022-01-24 | 7263754.57142857 | 0.198902961508907 | |
jairbolsonaro | 2022-01-31 | 7281492.14285714 | 0.244192879235494 | |
jairbolsonaro | 2022-02-07 | 7298657.57142857 | 0.235740535520157 | |
jairbolsonaro | 2022-02-14 | 7312644 | 0.191630151634725 | |
jairbolsonaro | 2022-02-21 | 7344081.42857143 | 0.429905087290283 | |
jairbolsonaro | 2022-02-28 | 7384535.375 | 0.550837389563652 | |
jairbolsonaro | 2022-03-07 | 7414500.625 | 0.405783823603123 | |
jairbolsonaro | 2022-03-14 | 7450088.42857143 | 0.47997573095393 | |
jairbolsonaro | 2022-03-21 | 7479327.42857143 | 0.392465140250775 | |
jairbolsonaro | 2022-03-28 | 7504820.28571429 | 0.340844245506267 | |
jairbolsonaro | 2022-04-04 | 7528828.14285714 | 0.319899161190529 | |
jairbolsonaro | 2022-04-11 | 7549807.66666667 | 0.278655899848479 | |
jairbolsonaro | 2022-04-25 | 7783848.5 | 3.09995755741768 | |
jairbolsonaro | 2022-05-02 | 7900176.4 | 1.49447795650186 | |
LulaOficial | 2021-11-29 | 2906394.14285714 | 0.697884948148264 | |
LulaOficial | 2021-12-06 | 2929411.71428571 | 0.791963178330102 | |
LulaOficial | 2021-12-13 | 2949187.57142857 | 0.675079472319218 | |
LulaOficial | 2021-12-20 | 2967984.28571429 | 0.637352281957759 | |
LulaOficial | 2021-12-27 | 2982839.42857143 | 0.500512854082302 | |
LulaOficial | 2022-01-03 | 3001672.42857143 | 0.63137827063724 | |
LulaOficial | 2022-01-10 | 3021001.14285714 | 0.643931499711092 | |
LulaOficial | 2022-01-17 | 3044262.42857143 | 0.769985995181921 | |
LulaOficial | 2022-01-24 | 3064701.85714286 | 0.671408232733084 | |
LulaOficial | 2022-01-31 | 3080266.57142857 | 0.507870423005019 | |
LulaOficial | 2022-02-07 | 3093853.85714286 | 0.441107462591606 | |
LulaOficial | 2022-02-14 | 3108430.71428571 | 0.471155323293715 | |
LulaOficial | 2022-02-21 | 3127866.42857143 | 0.625258082684366 | |
LulaOficial | 2022-02-28 | 3152402.5 | 0.78443475733001 | |
LulaOficial | 2022-03-07 | 3172365.5 | 0.633263043028287 | |
LulaOficial | 2022-03-14 | 3193491.28571429 | 0.665931643572781 | |
LulaOficial | 2022-03-21 | 3215096.57142857 | 0.676541245342799 | |
LulaOficial | 2022-03-28 | 3243115.42857143 | 0.871477932944575 | |
LulaOficial | 2022-04-04 | 3271694.85714286 | 0.881233776622548 | |
LulaOficial | 2022-04-11 | 3292958.33333333 | 0.649922352754051 | |
LulaOficial | 2022-04-25 | 3382529.66666667 | 2.72008705444697 | |
LulaOficial | 2022-05-02 | 3421453.2 | 1.15072260021569 | |
simonetebetbr | 2022-03-28 | 303720.571428571 | 0.154185260680495 | |
simonetebetbr | 2022-04-04 | 305212.857142857 | 0.491335080553368 | |
simonetebetbr | 2022-04-11 | 305767.666666667 | 0.181777900512836 | |
simonetebetbr | 2022-04-25 | 308489.333333333 | 0.89010937498295 | |
simonetebetbr | 2022-05-02 | 309255.4 | 0.248328413300092 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(lubridate) | |
d <- read.csv("query.csv", header = T) %>% filter(screen_name == "jairbolsonaro" | screen_name == "LulaOficial" | screen_name == "cirogomes" | screen_name == "simonetebetbr") | |
d$date <- as.Date(d$dia) | |
d$semana <- cut(d$date, "week", start.on.monday = TRUE) | |
m <- d %>% | |
group_by(screen_name,semana) %>% | |
summarise(med = mean(followers_count)) %>% | |
mutate(var_semana = ((med/lag(med) - 1) * 100)) %>% | |
drop_na(var_semana) | |
m$semana <- as.Date(m$semana) | |
m %>% ggplot(aes(semana,var_semana,fill=screen_name)) + | |
geom_bar(stat = "identity", position = "dodge") + | |
scale_x_date(date_breaks = "1 month", date_labels = "%b %Y") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment