
rmarkdown에 다음 청크가 있습니다
{r }
library(psych)
a <- (matrix(c(1:1000), ncol=4))
f <- fa(a)
하지만 인라인으로 인쇄하려고 하면 다음과 같은 결과가 출력됩니다.
`r f$null.chisq`
다음 오류 메시지가 표시되고 PDF가 생성되지 않습니다.
/usr/local/bin/pandoc +RTS -K512m -RTS prova2.utf8.md --to latex
--from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash-implicit_figures
--output prova2.pdf --template /Library/Frameworks/R.framework/Versions/3.2/Resources/library/rmarkdown/rmd/latex/default-1.14.tex
--highlight-style tango --latex-engine /Library/TeX/texbin/pdflatex --variable 'geometry:margin=1in'
! Missing $ inserted. <inserted text>
$ l.162 1.6708458\times
pandoc: Error producing PDF from TeX source Error: pandoc document
conversion failed with error 43 Execution halted
Windows 컴퓨터에서 똑같은 코드를 테스트했는데 제대로 작동하지만 내 Mac에서는 작동하지 않습니다. 즉, 이 오류가 완전히 재현되지 않을 수도 있다는 것을 알고 있습니다. 또한 재현 가능한 오류에 대한 스크립트를 저장한 파일에 162번째 줄도 없어서 그 내용을 이해하는 데 어려움을 겪고 있습니다.
$ l.162
실제로 의미합니다.
그러나 코드의 마지막 줄을 생략하면, 즉
`r f$null.chisq`
그러면 모든 것이 잘 작동합니다.
답변1
$$
과학 표기법으로 작성된 숫자를 추가하십시오 .뜨개질을 하는 사람.
$`r f$null.chisq`$