2013-03-31 14 views
3

我使用pander通过RStudio,knitr,pander,pandoc,Word打印出更漂亮的表格。 我有一个两页表,而我想补充一个西班牙语字幕:如何更改pander中的英文字幕?

set.caption("Límites izquierdo y derecho para las diferentes variables") 
pander(LimitesUnivariado, include.rownames=FALSE) 

这几乎工作,但我的标题指出:

Table: Límites izquierdo y derecho para las diferentes variables (continued below) 

我找不到找到方法将Tablecontinued below更改为其西班牙文等值。有人知道该怎么做吗?

+0

看着[代码](https://github.com/Rapporter/pander/blob/master/R/helpers.R)看起来这些都是硬编码的。软件包作者@daroczig经常虽然所以他可能会在某个时候看到这一点。虽然你可能想提交一个问题[这里](https://github.com/Rapporter/pander/issues)。 – Dason

+0

@dason我已经提交了问题,谢谢! – ap53

+0

感谢@ ap53的问题,我一定会在'pander'软件包中添加一个新选项,以便在接下来的几天内更新'继续下面的'硬编码字符串到任何东西(希望在24小时内) - 尽管不确定要让用户更新作为Pandoc语法的一部分的'Table:'前缀:http://johnmacfarlane.net/pandoc/README.html#tables PS:我已将“pander”标记添加到问题 – daroczig

回答

4

谢谢你的reporting this issue on GitHub,我刚刚推了几行到master分支,它引入了两个新选项来调整标题,如果表被拆分。简单的例子:

  1. 更新分解表的默认标题不指定字幕:

    > panderOptions('table.continues', 'Continuará') 
    > pander(mtcars) 
    
  2. 更新贴上级联到用户指定的标题如果表被分裂:

    > panderOptions('table.continues.affix', '(continuará)') 
    > set.caption('MTCARS') 
    > pander(mtcars) 
    

install the most recent version of pander并验证此更新是否适用于您 - 对不起请注意,不幸的是我不会说西班牙语。

PS:我没碰过的Table:前缀,似乎在Pandoc的语法这是由Pandoc除去自动反正当转换到其他一些文件格式正在做指定:请参见relevant docs。但是如果你也能找到关于后者的新选项,我会很高兴地将它添加到包中。

+0

它的工作原理!感谢您的快速回答。我可以用表问题;-) – ap53

+0

的'相关docs'状态住: ''' 一个标题为以字符串表开头的段落:(或只是:),这将被剥离。 ''' 你认为只使用':'的选项会起作用吗? – ap53

+1

当然,请检查新的'table.caption.prefix'选项,@ ap53:https://github.com/Rapporter/pander/commit/0eb5e9af9ce8744c937caeef3060596b99cf3179 – daroczig