Hmisc describe output when export as latex file giving API error 2

I am new to latex and I am trying to output the R results from describe( ) function through latex( ).

A .tex file is being created but it is not giving me a pdf output

df = data.frame(A = rnorm(n = 100, 0,1)) %>% dplyr::mutate(B = 2*A+ runif(n = 100,-0.05,0.05))
# call latex( )
f = 'sample.tex'
df_latext = Hmisc::latex(describe(df,descript = 'Sample Description'), file = f)

When I run df_latext in the R console it is giving me the following error:

MiKTeX Problem Report
Message: Windows API error 2: The system cannot find the file specified.

Data: path="C:\Users\domjo\AppData\Local\Temp\RtmpiYZcTM\file56f02ed47c3a.dvi"
Source: Libraries\MiKTeX\Core\File\win\winFile.cpp
Line: 301
MiKTeX: 22.8
OS: Windows 10.0.22000
Invokers: .../explorer/rstudio/rsession
SystemAdmin: no
Root0: C:\Users\domjo\AppData\Roaming\MiKTeX
Root1: C:\Users\domjo\AppData\Local\MiKTeX
Root2: C:\Users\domjo\AppData\Local\Programs\MiKTeX
UserInstall: C:\Users\domjo\AppData\Local\Programs\MiKTeX
UserConfig: C:\Users\domjo\AppData\Roaming\MiKTeX
UserData: C:\Users\domjo\AppData\Local\MiKTeX

Also, I tried running the .tex file created but its giving the following error saying Environment spacing undefined.:

! LaTeX Error: Environment spacing undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
l.1 \begin{spacing}{0.7}

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.