问题描述
几天前,我开始用德语R-Script写作.不幸的是,当我knit()
文档时,以下代码块不起作用:
A few days ago, I started writing on a german R-Script. Unfortunately, the following code chunk doesn't work when I knit()
the document:
@
<<>>=
äö <- ordered(c(1,3,2,2))
@
有人可以帮我解决这个问题吗?
Can anyone help me solve this problem?
PS:我正在使用Linux.
PS: I'm working with Linux.
推荐答案
由于您使用的是Linux,因此操作应该很容易.这可能只是LaTeX问题.最重要的是,您是否指定了文档的编码?例如\usepackage[utf8]{inputenc}
.这在Ubuntu下对我有效.
Since you are using Linux, things should be easy. It is probably just a LaTeX problem; most importantly, did you specify the encoding of your document? e.g. \usepackage[utf8]{inputenc}
. This works for me under Ubuntu.
\documentclass[ngerman]{article}
\usepackage[utf8]{inputenc}
\begin{document}
<<>>=
äö <- ordered(c(1,3,2,2))
@
\end{document}
顺便说一句,在R对象名称中使用非ASCII字符也许不是一个好主意,尽管它们也可以使用.
BTW, perhaps it is not a good idea to use non-ASCII characters in R object names, although they also work.
这篇关于编织器和UTF8编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!