LaTeX Error when knitting a PDF in R Markdown (elsarticle)

I am trying to knit a document in R Markdown (using the elsarticle documentclass)

The following error appears.

output file: Hirst_18276806_finmetrics.knit.md

tlmgr search --file --global "/lineno.sty"
First directive needs to be 'name', not ue-also tex-gyre at C:/Users/Tanga/AppData/Roaming/TinyTeX/tlpkg/TeXLive/TLPOBJ.pm line 104, <TMP> line 10340.
! LaTeX Error: File `lineno.sty' not found.

! Emergency stop.
<read *> 

Error: Failed to compile Hirst_18276806_finmetrics.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See Hirst_18276806_finmetrics.log for more info.
In addition: Warning message:
funs() is soft deprecated as of dplyr 0.8.0
Please use a list of either functions or lambdas: 

  # Simple named list: 
  list(mean = mean, median = median)

  # Auto named with `tibble::lst()`: 
  tibble::lst(mean, median)

  # Using lambdas
  list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
This warning is displayed once per session. 
Execution halted

I've added the contents of my log below

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex 2020.1.13)  30 JAN 2020 06:58
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**Hirst_18276806_finmetrics.tex
(./Hirst_18276806_finmetrics.tex
LaTeX2e <2019-10-01> patch level 3

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/elsarticle/elsarti
cle.cls
Document Class: elsarticle 2019/02/25, 3.2: Elsevier Ltd
\@bls=\dimen102
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/size11.clo
File: size11.clo 2019/10/25 v1.4k Standard LaTeX file (size option)
)
\[email protected]=\count80
\[email protected]=\count81
\[email protected]=\count82
\[email protected]=\count83
\[email protected]=\count84
\[email protected]=\count85
\[email protected]=\count86
\[email protected]=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen103
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graphicx.
sty
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/keyval.st
y
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\[email protected]@=\toks14
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/graphics.
sty
Package: graphics 2019/11/01 v1.3d Standard LaTeX Graphics (DPC,SPQR)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-cfg/graph
ics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: pdftex.def on input line 105.

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/graphics-def/pdfte
x.def
File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
))
\[email protected]@height=\dimen104
\[email protected]@width=\dimen105
)
\[email protected]=\count88
\[email protected]=\count89
\[email protected]=\count90
\[email protected]=\count91
\[email protected]=\count92
\@eadauthor=\toks15
\[email protected]=\count93
\absbox=\box27
\elsarticlehighlightsbox=\box28
\elsarticlegrabsbox=\box29
\keybox=\box30
\Columnwidth=\dimen106
\[email protected]=\dimen107
\[email protected]=\box31
\[email protected]=\box32
\leftMargin=\dimen108
\@enLab=\toks16
\@sep=\skip43
\@@sep=\skip44
(./Hirst_18276806_finmetrics.spl) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf
-dist/tex/latex/natbib/natbib.sty
Package: natbib 2010/09/13 8.31b (PWD, AO)
\bibhang=\skip45
\bibsep=\skip46
LaTeX Info: Redefining \cite on input line 694.
\[email protected]@ctr=\count94
)
\splwrite=\write3
\openout3 = `Hirst_18276806_finmetrics.spl'.

\appnamewidth=\dimen109
) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/lm/lmodern.sty
Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
LaTeX Font Info:    Overwriting symbol font `letters' in version `normal'
(Font)                  OML/cmm/m/it --> OML/lmm/m/it on input line 23.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `normal'
(Font)                  OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `normal'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
LaTeX Font Info:    Overwriting symbol font `letters' in version `bold'
(Font)                  OML/cmm/b/it --> OML/lmm/b/it on input line 27.
LaTeX Font Info:    Overwriting symbol font `symbols' in version `bold'
(Font)                  OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
LaTeX Font Info:    Overwriting symbol font `largesymbols' in version `bold'
(Font)                  OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `bold'
(Font)                  OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/setspace/setspace.
sty
Package: setspace 2011/12/19 v6.7a set line spacing
) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\[email protected]@type=\count95
\[email protected]=\toks17
\[email protected]=\box33
\@[email protected]=\toks18
\@floatcapt=\box34
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifxetex.st
y
Package: ifxetex 2019/10/25 v0.7 ifxetex legacy package. Use iftex instead.
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/iftex.sty
Package: iftex 2019/11/07 v1.0c TeX engine tests
))
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/generic/iftex/ifluatex.s
ty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/fixltx2e.st
y
Package: fixltx2e 2016/12/29 v2.1a fixes to LaTeX (obsolete)
Applying: [2015/01/01] Old fixltx2e package on input line 46.

Package fixltx2e Warning: fixltx2e is not required with releases after 2015
(fixltx2e)                All fixes are now in the LaTeX kernel.
(fixltx2e)                See the latexrelease package for details.

Already applied: [0000/00/00] Old fixltx2e package on input line 53.
) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2018/08/11 v2.0j Standard LaTeX package
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2018/08/11 v2.0j Standard LaTeX file
LaTeX Font Info:    Redeclaring font encoding T1 on input line 48.
)) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/base/inputenc.s
ty
Package: inputenc 2018/08/11 v1.3c Input encoding file
\[email protected]=\toks19
\[email protected]=\toks20
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amssymb.s
ty
Package: amssymb 2013/01/14 v3.01 AMS font symbols

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsfonts/amsfonts.
sty
Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
\@emptytoks=\toks21
\symAMSa=\mathgroup4
\symAMSb=\mathgroup5
LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
(Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
))
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsmath.st
y
Package: amsmath 2019/11/16 v2.17d AMS math features
\@mathmargin=\skip47
For additional information on amsmath, use the `?' option.

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amstext.st
y
Package: amstext 2000/06/29 v2.01 AMS text

(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks22
\[email protected]=\dimen110
))
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\[email protected]=\dimen111
)
(c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amsmath/amsopn.sty
Package: amsopn 2016/03/08 v2.02 operator names
)
\[email protected]=\count96
LaTeX Info: Redefining \frac on input line 227.
\[email protected]=\count97
\[email protected]=\count98
LaTeX Info: Redefining \overline on input line 389.
\[email protected]=\count99
\[email protected]=\count100
LaTeX Info: Redefining \ldots on input line 486.
LaTeX Info: Redefining \dots on input line 489.
LaTeX Info: Redefining \cdots on input line 610.
\[email protected]=\box35
\[email protected]=\box36
\[email protected]=\dimen112
LaTeX Font Info:    Redeclaring font encoding OML on input line 733.
LaTeX Font Info:    Redeclaring font encoding OMS on input line 734.
\[email protected]=\count101
\[email protected]=\count102
\[email protected]=\muskip10
\[email protected]=\count103
\[email protected]=\count104
\[email protected]=\toks23
\[email protected]=\count105
\[email protected]=\count106
\[email protected]=\count107
\[email protected]=\toks24
\[email protected]=\dimen113
\[email protected]=\dimen114
\[email protected]=\dimen115
\[email protected]=\dimen116
\[email protected]=\dimen117
\[email protected]=\dimen118
\@envbody=\toks25
\multlinegap=\skip48
\multlinetaggap=\skip49
\[email protected]=\toks26
LaTeX Info: Redefining \[ on input line 2858.
LaTeX Info: Redefining \] on input line 2859.
) (c:/Users/Tanga/AppData/Roaming/TinyTeX/texmf-dist/tex/latex/amscls/amsthm.st
y
Package: amsthm 2017/10/31 v2.20.4
\[email protected]=\toks27
\[email protected]=\toks28
\[email protected]=\toks29
\[email protected]=\toks30
\[email protected]=\toks31
\[email protected]=\skip50
\[email protected]=\skip51
\[email protected]=\skip52
\[email protected]=\toks32
LaTeX Info: Redefining \qed on input line 274.
)

! LaTeX Error: File `lineno.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.49 \linenumbers
                 ^^M 
Here is how much of TeX's memory you used:
 2830 strings out of 494107
 33829 string characters out of 6172229
 90220 words of memory out of 5000000
 6945 multiletter control sequences out of 15000+600000
 4709 words of font info for 16 fonts, out of 8000000 for 9000
 14 hyphenation exceptions out of 8191
 38i,0n,38p,221b,39s stack positions out of 5000i,500n,10000p,200000b,80000s

!  ==> Fatal error occurred, no output PDF file produced!

Does anyone have advice on how to debug this?

TIA!

Relevant tags