R Studio on Mac - latex command not working

59 Views Asked by At

I am trying to use latex function to output regression formula. like this:

require(rms)`
f <- cph(Surv(...) ~ ...)`
latex(f)`

but getting an error I don't understand. I installed Xcode, MacTeX. Can anyone help me?

Maybe it is a data error?

This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=latex) restricted \write18 enabled. entering extended mode

(/var/folders/y8/dcqwxmkn4qgd15mj86hyt1sr0000gp/T//RtmpN1ROBO/file1416d26bf8cef .tex LaTeX2e <2022-11-01> patch level 1 L3 programming layer <2023-02-22> (/usr/local/texlive/2023/texmf-dist/tex/latex/base/report.cls Document Class: report 2022/07/02 v1.4n Standard LaTeX document class (/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2023/texmf-dist/tex/latex/geometry/geometry.sty (/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2023/texmf-dist/tex/generic/iftex/ifvtex.sty (/usr/local/texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty))) (/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-dvips.def) No file file1416d26bf8cef.aux. geometry driver: auto-detecting geometry detected driver: dvips

Overfull \hbox (1097.7373pt too wide) in paragraph at lines 6--12

[1] (./file1416d26bf8cef.aux) ) (see the transcript file for additional information) Output written on file1416d26bf8cef.dvi (1 page, 1144 bytes). Transcript written on file1416d26bf8cef.log. Error: Can't open display: :0 There were 17 warnings (use warnings() to see them)

and those 17 warnings:

Warning messages: 1: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 2: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 3: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 4: In is.na(xj) : is.na() applied to non-(list or vector) of type 'language' 5: In is.na(xk) : is.na() applied to non-(list or vector) of type 'language' 6: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 7: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 8: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 9: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 10: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 11: In is.na(xj) : is.na() applied to non-(list or vector) of type 'language' 12: In is.na(xk) : is.na() applied to non-(list or vector) of type 'language' 13: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 14: In is.na(xj) : is.na() applied to non-(list or vector) of type 'language' 15: In is.na(xk) : is.na() applied to non-(list or vector) of type 'language' 16: In cbind(cx, cxk) : number of rows of result is not a multiple of vector length (arg 2) 17: In system(cmd, intern = TRUE, wait = TRUE) : running command 'xdvi -paper 5.5x7in -s 0 /var/folders/y8/dcqwxmkn4qgd15mj86hyt1sr0000gp/T//RtmpN1ROBO/file1416d26bf8cef.dvi' had status 1

0

There are 0 best solutions below