This file is the technical appendix to an article on the place of science in Franco-Canadian media during the first wave of the COVID-19 pandemic.

Its main function, in the spirit of an open science, is to show how our results are produced. If you need data to reproduce some results, please contact François.

The secondary function of this appendix is to give additional results that did not fit in the main paper.

1 Preliminary tasks

Loading packages:

package_list <- c("ggplot2","dplyr","mongolite","data.table","tidyr","stringr","ggrepel","fuzzyjoin",
                  "anytime","topicmodels","tm","knitr","tidytext","doParallel","zoo","lubridate",
                  "udpipe","splitstackshape","Matrix","text2vec", "stargazer", "sandwich", "mgcv", "viridis", "directlabels", "kableExtra")
for(p in package_list){
  if (p %in% installed.packages()==FALSE){install.packages(p,dependencies = TRUE)}
  library(p,character.only=TRUE)
}

Creating global variables:

data_folder <- "/data/covid/"

#Connections
DB_connection_this_year <- mongolite::mongo(db = "projetThinkTank", collection = "all_articles_01122019_30062020")
DB_connection_2019 <- mongolite::mongo(db = "projetThinkTank", collection = "all_articles_01122018_30062019")
DB_connection_2018 <- mongolite::mongo(db = "projetThinkTank", collection = "all_articles_01012018_30062018")
DB_connection_2017 <- mongolite::mongo(db = "projetThinkTank", collection = "all_articles_01012017_30062017")
#Query to get articles that talk about COVID
query_keywords <- paste0('{ "$or" : [ {"full_article_text": {"$regex": "COVID","$options": "i"}},
                                      {"full_article_text": {"$regex": "virus", "$options": "i"}},
                                      {"full_article_text": {"$regex": "SARS-CoV", "$options": "i"}},
                                      {"full_article_text": {"$regex": "SRAS-CoV", "$options": "i"}}]}')

olivier_data_folder <- "/home/olivier/my_data/"

liste_media <- read.csv(paste0(data_folder,"liste_finale_medias.csv")) %>% data.table()
liste_media <- liste_media[dans_oci == TRUE]

size_axis_text <- 11
pos_vline <- as.Date("2020-03-14")

Loading functions:

source("FCT_util.R")

2 Information on corpus

2.1 OCI corpus of media articles

load(paste0(data_folder, "dt_full_text_for_count_sci.RData"))

dt_full_text <- dt_full_text[month(date) %in% 1:6 & year(date) %in% 2017:2020] # first half of years
dt_full_text[is_science == TRUE & year(date) ==2020, Status := "Science during COVID"]
dt_full_text[is_science == TRUE & year(date) <2020, Status := "Science before COVID"]
dt_full_text[is_science == FALSE & year(date) <2020, Status := "Not Science before COVID"]
dt_full_text[is_science == FALSE & year(date) ==2020, Status := "Not Science during COVID"]

count <- dt_full_text[,list(doc_ID, Status)] %>% unique()

kable(count[,.N, by = Status], caption = "Breakdown of the OCI article corpus by combinations of the two main dichotomous variables")  %>%  kable_styling("hover")
Breakdown of the OCI article corpus by combinations of the two main dichotomous variables
Status N
Not Science before COVID 665520
Science before COVID 32996
Not Science during COVID 247001
Science during COVID 17310
dt_full_text[,list(`Total number of articles` = .N, `Science related` = sum(is_science),
               `During COVID` = sum(is_covid)),by = root_url][order(-`Total number of articles`)]  %>% 
  kable(caption = "Breakdown of the OCI corpus by media") %>%  kable_styling() %>%
    scroll_box(width = "100%", height = "200px")
Breakdown of the OCI corpus by media
root_url Total number of articles Science related During COVID
www.lapresse.ca 112937 7233 9755
www.journaldemontreal.com 103204 5020 10179
www.journaldequebec.com 101236 4900 9715
ici.radio-canada.ca 84064 4877 12249
journalmetro.com 50518 2624 2589
www.ledevoir.com 40893 4681 2967
www.tvanouvelles.ca 40377 2189 6395
www.lesoleil.com 29470 2088 4853
www.latribune.ca 22984 1387 3856
quebec.huffingtonpost.ca 20752 2084 2881
www.lenouvelliste.ca 20473 1149 3720
www.lequotidien.com 19196 1181 3246
www.lavoixdelest.ca 18397 1342 3606
www.lanouvelle.net 13997 343 1366
lactualite.com 12368 1504 2939
www.fm93.com 12089 109 457
www.fm1069.ca 11167 109 528
www.lecourrierdusud.ca 8488 281 547
www.lavantage.qc.ca 7833 161 53
www.lereflet.qc.ca 7614 156 569
www.journalexpress.ca 7280 226 703
www.cybersoleil.com 6819 146 535
www.infodimanche.com 6449 196 518
www.cihofm.com 5824 65 442
www.lhebdojournal.com 5337 206 366
www.enbeauce.com 4807 133 666
www.chga.fm 4754 33 176
www.fm1033.ca 4699 75 46
chipfm.com 4644 37 229
www.lecourriersud.com 4629 142 567
www.courrierfrontenac.qc.ca 4536 134 372
www.lhebdodustmaurice.com 4394 145 348
www.laction.com 4186 95 401
www.journallenord.com 3936 136 237
www.lerefletdulac.com 3762 82 233
www.lavoixdusud.com 3702 90 279
www.leplacoteux.com 3632 118 312
lenord-cotier.com 3614 87 691
courrierlaval.com 3568 109 12
www.lechodemaskinonge.com 3559 116 343
www.granbyexpress.com 3486 99 367
www.lemanic.ca 3409 115 700
www.les2rives.com 3390 119 24
www.lechodelatuque.com 3387 75 337
www.leclaireurprogres.ca 3362 88 412
www.fm1047.ca 3317 41 443
www.larevue.qc.ca 3254 85 27
www.hebdorivenord.com 3248 68 302
www.lecharlevoisien.com 3246 78 80
www.journaldechambly.com 3150 103 274
www.nordinfo.com 3001 87 48
www.leveil.com 2938 93 36
www.letincelle.qc.ca 2872 79 169
www.journalleguide.com 2843 95 327
www.leprogres.net 2830 70 154
www.nouvelleshebdo.com 2780 80 191
www.letoiledulac.com 2776 84 197
www.laveniretdesrivieres.com 2741 88 328
www.lelacstjean.com 2678 70 213
www.coupdoeil.info 2672 85 306
www.lactiondautray.com 2493 62 263
www.canadafrancais.com 2396 71 114
www.radiogaspesie.ca 2334 68 348
www.lareleve.qc.ca 2330 125 54
linformationdunordmonttremblant.ca 2314 65 134
www.courrierdeportneuf.com 2309 54 186
ckmn.fm 2173 58 115
journaldesvoisins.com 2160 167 243
beauce.tv 2155 11 10
www.quebechebdo.com 2139 83 66
www.rcinet.ca 2127 368 131
www.lapetitenation.com 2040 47 144
www.estrieplus.com 2022 75 0
www.journalsaint-francois.ca 2022 49 0
www.oeilregional.com 1992 60 125
www.beaucemedia.ca 1936 47 215
linformationdunordvalleedelarouge.ca 1768 56 103
www.chamblyexpress.ca 1475 55 311
www.radio-acton.com 1460 10 16
www.lejournaldejoliette.ca 1426 52 55
lautjournal.info 1422 224 184
www.tvrs.ca 1415 32 185
www.lechodelaval.ca 1336 95 52
www.lechodelarivenord.ca 1112 24 55
www.carrefourdequebec.com 1103 66 11
www.lechodetroisrivieres.ca 1091 60 62
echodefrontenac.com 1074 22 33
www.lepeuplelotbiniere.ca 967 44 130
radiox.com 848 8 56
www.sorel-tracyexpress.ca 793 24 59
www.lecantonnier.com 747 19 68
www.1031fm.ca 727 3 5
www.lattisee.com 695 26 27
mediat.ca 685 7 111
www.journallereflet.com 684 30 103
www.lavantagegaspesien.com 673 9 11
www.journalhorizon.com 653 21 212
www.leradar.qc.ca 595 10 25
autourdelile.com 580 15 64
lametropole.com 571 53 26
www.indicebohemien.org 524 33 13
monlimoilou.com 501 23 7
www.lecourrier.qc.ca 481 2 27
www.lavantposte.ca 473 12 5
www.journal-le-sentier.ca 445 26 30
radio-centreville.com 436 30 95
tremblantexpress.com 425 18 9
www.journal-ensemble.org 419 14 24
journaloutremont.com 418 23 27
lapensee.qc.ca 401 9 72
journalmobiles.com 397 46 9
www.lasentinelle.ca 328 5 5
laviedici.com 317 5 17
www.lelavalois.com 310 14 9
www.ckrl.qc.ca 305 3 3
monsaintroch.com 279 14 11
csur.tv 275 1 16
929cfut.com 274 4 17
echodenhaut.org 274 8 4
www.lebulletindeschenaux.com 266 7 5
www.entreelibre.info 255 20 17
www.droitdeparole.org 235 16 24
www.lexpressmontcalm.com 230 1 46
www.moutonnoir.com 223 32 8
www.leclairon.qc.ca 222 6 49
graffici.ca 205 15 8
monsaintsauveur.com 202 8 7
www.tvr9.org 197 3 25
ski-se-dit.info 184 10 10
tvc.qc.ca 181 1 27
echosmontreal.com 146 11 4
www.lecitoyenrouynlasarre.com 135 5 59
cfmf.rocks 117 0 48
cfim.ca 102 9 14
www.versants.com 89 0 39
ctbtv.ca 57 3 35
www.via905.fm 46 0 8
tcfrontenac.org 33 0 1
www.gaboteur.ca 10 3 4
n_media_OCI <- dt_full_text$root_url %>% unique() %>% length()

rm(dt_full_text)

The total number of media in this corpus is 139.

2.2 Facebook corpus

fb_2017 <- read.csv("/data/jhr/postsFBcovid-2017.csv") %>% data.table()
fb_2018 <- read.csv("/data/jhr/postsFBcovid-2018.csv") %>% data.table()
fb_2019 <- read.csv("/data/jhr/postsFBcovid-2019.csv") %>% data.table()
fb_2020 <- read.csv("/data/jhr/postsFBcovid-2020.csv") %>% data.table()

fb_2017$year <- 2017
fb_2018$year <- 2018
fb_2019$year <- 2019
fb_2020$year <- 2020

fb_posts <- rbind(fb_2017, fb_2018, fb_2019, fb_2020)
rm(fb_2017,fb_2018,fb_2019,fb_2020)

fb_posts[grepl("(\\s)scien", texteComplet) | grepl("(\\s)chercheu", texteComplet),
         is_science := TRUE][is.na(is_science), is_science := FALSE]


# binary variable for the COVID period
fb_posts[year>=2020, since_COVID := TRUE][is.na(since_COVID), since_COVID := FALSE]

## Dividing between four cases:
 fb_posts[is_science == TRUE & since_COVID == TRUE, Status := "Science during COVID"]
 fb_posts[is_science == TRUE & since_COVID == FALSE, Status := "Science before COVID"]
 fb_posts[is_science == FALSE & since_COVID == FALSE, Status := "Not Science before COVID"]
 fb_posts[is_science == FALSE & since_COVID == TRUE, Status := "Not Science during COVID"]

 # making sure that the scope is okay.
 fb_posts <- fb_posts[month(as.Date(jour)) %in% 1:6 & year(as.Date(jour)) %in% 2017:2020]
  
kable(fb_posts[,.N, by = Status], caption = "Breakdown of the Facebook corpus by combinations of the two main dichotomous variables")   %>%  kable_styling("hover")
Breakdown of the Facebook corpus by combinations of the two main dichotomous variables
Status N
Not Science before COVID 102166
Science before COVID 1046
Not Science during COVID 60100
Science during COVID 562
# keeping an object with the names of all media having at least one post in our data.
fb_posts[,list(`Total number of posts` = .N, `Science related` = sum(is_science),
               `During COVID` = sum(since_COVID)),by = media][order(-`Total number of posts`)] %>% 
  kable(caption = "Breakdown of the Facebook corpus by media") %>%  kable_styling() %>%
    scroll_box(width = "100%", height = "200px")
Breakdown of the Facebook corpus by media
media Total number of posts Science related During COVID
Le Journal de Québec 13346 80 3533
Le Journal de Montréal 10885 101 3334
La Presse 8877 176 2726
TVA Nouvelles 8727 72 2819
HuffPost Québec 8690 88 1653
Le Soleil 8027 108 2970
Le Devoir 6304 174 2084
Radio-Canada Information 5604 130 1937
Le Nouvelliste 5492 55 2248
Le Quotidien 4646 66 2008
La Tribune 4564 63 2319
Journal Métro 3993 64 1020
La Voix de l’Est 3123 37 1597
ICI Québec 2586 27 1033
www.lanouvelle.net 2289 2 880
ICI Mauricie Centre-du-Québec 1985 18 804
TVA Gatineau-Ottawa 1842 4 870
98,5 FM 1764 9 599
ICI Ottawa Gatineau 1750 6 527
ICI Saguenay–Lac-Saint-Jean 1546 4 672
ICI Estrie 1542 9 663
ICI Grand Montréal 1458 27 465
FM Charlevoix - CIHO 96,3 1267 1 655
Le Charlevoisien 1267 1 796
L’actualité 1232 63 379
Le Courrier du Sud 1215 1 502
ICI Côte-Nord 1195 17 457
104,7 Outaouais 1179 5 812
Le Citoyen Rouyn - La Sarre 1168 2 436
ICI Abitibi-Témiscamingue 1145 7 562
L’Avantage 1089 5 218
L’Hebdo du St-Maurice 1075 4 315
ICI Bas-Saint-Laurent 1075 22 493
EnBeauce.com 1059 5 468
Les 2 Rives 1043 2 322
Journal Mobiles 1034 7 464
Le Courrier Sud 1032 4 249
ICI Gaspésie-Les-Îles 1016 6 445
Le Nord-Côtier 999 2 485
Journal L’Express de Drummondville 971 2 562
CFIM, la radio des Îles de la Madeleine 954 16 484
Info Dimanche 948 3 493
TVA Québec 890 3 437
Journal Le Reflet 884 0 609
FM 103,3 - La radio allumée 884 33 329
L’Éclaireur Progrès 824 3 245
Journal Le Manic 798 2 446
TVA Nouvelles Abitibi-Témiscamingue 780 1 335
Le Soleil de Châteauguay 778 0 572
TVA Est-du-Québec 712 2 298
TVA Saguenay-Lac-St-Jean 705 2 382
FM93 Québec 672 1 269
MédiAT 662 0 314
Écho de La Tuque 613 0 268
Journal Saint-François 588 1 437
L’Écho de Maskinongé 568 0 219
TVA Sherbrooke 568 2 309
Journal L’Action 557 0 272
Journal Le Lac-St-Jean 542 0 229
Courrier Laval 540 3 336
L’Hebdo Journal 530 2 200
Courrier Frontenac 528 1 175
L’info du Nord Mont-Tremblant 517 0 226
L’info de la Basse-Lièvre 516 2 193
Journal de Chambly 498 0 148
Le Reflet du Lac 487 0 162
CHGA FM, la radio de la Vallée-de-la-Gatineau 480 0 270
L’Avantage Gaspésien 461 6 123
Beauce Média 458 0 122
Hebdomadaire La Revue de Terrebonne 434 0 236
Journal Nouvelles Hebdo 427 2 174
Journal La Voix du Sud 420 0 188
Le Placoteux 417 3 221
Radio X - CHOI 98,1 407 0 256
Hebdo Rive Nord 405 2 195
Journal Coup d’oeil 391 2 157
BeauceTV 389 0 185
Radio Gaspésie 389 3 264
GranbyExpress.com 380 0 119
L’info Petite Nation 378 0 119
Québec Hebdo 365 1 117
Journal L’Étoile du Lac 363 0 148
VIA 90.5 FM 358 2 229
Journal Le Canada Français 350 1 131
EstriePlus.com Le Journal Internet 349 4 103
Journal La Pensée de Bagot 338 0 117
TVR9 309 1 79
L’OEil Régional 304 0 121
Radio Acton 297 0 123
Monlimoilou 291 2 86
Journal Le Nord 275 1 144
106.9 FM Mauricie 273 2 169
Le Courrier de Saint-Hyacinthe 269 0 110
Le Journal de Joliette 266 1 153
L’Avant-Poste 266 1 94
Country Pop 103,1 261 0 83
La Sentinelle 251 0 37
Journal L’Express Montcalm 251 0 104
L’Écho de Laval 249 0 86
Monsaintroch 248 1 65
L’info du Nord Vallée de la Rouge 243 0 124
CKRL 89,1 242 1 39
Courrier de Portneuf 240 0 124
Monsaintsauveur 215 0 57
Le Progrès de Coaticook 209 1 72
JournalLeGuide.com 189 0 38
L’Indice bohémien 186 4 81
L’Écho de Frontenac 185 0 31
Le Peuple Lotbinière 163 0 49
Actualités - L’Étincelle du Val SF 157 0 56
lAvenirEtDesRivieres.com 157 1 61
Journal Ski-se-Dit 157 1 31
L’aut’journal 156 1 59
Journal L’Action D’Autray 154 0 44
Bulletin des Chenaux 152 1 55
Radio Canada International 148 4 106
Le Radar, l’hebdomadaire des Îles 146 0 33
Journaldesvoisins.com 138 1 53
Journal L’Éveil 136 1 44
92,9 CFUT 131 0 26
CKMN.FM 125 0 40
Journal Autour de l’Île 123 0 94
Journal l’Écho d’en Haut Inc. 98 0 13
TVC Basse-Lièvre 98 0 45
Journal L’Horizon, presse coopérative des Basques 97 1 33
Csur la télé 93 0 13
Journal Le Carrefour de Québec 92 0 29
Le Nord Info 85 0 38
L’Écho de Trois-Rivières 84 0 35
Tremblant Express 75 1 36
Journal Le Sentier 71 0 15
JOURNAL GRAFFICI 67 1 14
Journal Le Mouton Noir 64 0 25
L’Écho de la Rive-Nord 60 0 23
Sorel-Tracy Express.ca 59 0 19
Journal La Relève 56 0 38
CTBTV 55 0 18
Journal Entrée Libre 50 0 27
CFMF 103,1 FM 50 0 24
Le Gaboteur 47 0 13
La Métropole 47 0 6
Journal Le Lavalois 46 0 13
CHIP 101.9 45 0 45
Chambly Express.ca 42 0 10
Journal Communautaire Le Cantonnier 41 0 22
Versants du Mont-Bruno 35 0 27
Journal Droit de Parole 34 0 8
Journal Outremont 34 1 17
Journal communautaire Ensemble pour bâtir 24 0 12
Television Rive-Sud-TVRS 22 0 17
La Vie d’Ici 19 0 3
TCFTV Montréal 11 0 9
Radio Centre-ville 8 0 2
n_media_FB <- fb_posts$media %>% unique() %>% length()
#names_media_FB <-  fb_posts$media %>% unique() %>% sort()

 rm(fb_posts)

The total number of media in the Facebook corpus is 153.

3 The progression of the pandemic in Quebec

With data from the Institut national de santé publique du Québec (here), we can produce a graph of the number of confirmed cases of COVID-19 in Quebec:

dt_covid_cases <- fread(paste0(data_folder,"nb_cas_COVID_qc.csv"))
dt_covid_cases <- dt_covid_cases[ , list(date = as.Date(`Date de déclaration du cas`), 
                       nb_cases = `Par lien épidémiologique` + `En laboratoire`)]


ggplot(dt_covid_cases, aes(x= date, y = nb_cases)) + geom_smooth(span = .1, se= FALSE) + theme_classic() +
  labs(x= "", y = "Number of new cases") + scale_x_date(date_breaks = "2 week", date_labels =  "%d %b") +
  theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1, size = size_axis_text),
        axis.text.y = element_text(size = size_axis_text))
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'