1

我想输出我的表的乳胶版本。我使用 xtable() 这样做,但有一个主要问题。当我尝试从我调用的函数中生成乳胶表时(通常也会做很多其他事情),文件被写为零长度!(我运行 Windows 7 x64,并使用 R 2.11)。

例子:

fnc <- function (my.table) {
    sink(file="paper/tables/output.tex",caption="my caption")
    xtable(my.table)
    sink()
}

当我直接在函数内部运行这三行时,文件被正确写入。当我调用 fnc(my.table) 时,文件被写为零长度。

为什么?谢谢!

4

1 回答 1

2

您需要在函数中使用 print :

print(xtable(my.table))
于 2010-11-10T01:54:41.810 回答