Sweave、Eclipse 和 R 入门

发布于 2024-09-07 08:30:45 字数 440 浏览 4 评论 0原文

我对 LaTex 和 R 很陌生,但我每天都在学习。我真的很喜欢使用 Eclipse,并且想加入这个行列并开始使用 Sweave 自动化我的工作;我对前景感到兴奋。

也就是说,我在此处关注了 Jeromy 的帖子 并认为(关键字,认为)一切都设置正确。但是,由于我对 LaTex 非常陌生,我如何测试它才能知道我是否已启动并运行并且确实可以创建 pdf?

简而言之,我想在开始深入研究模板和创建报告之前测试我的配置是否已启动并运行。在 Eclipse 中创建 pdf 的基本过程是什么?

任何帮助将非常感激!

谢谢,

布洛克

I am very new to LaTex and R, but I am learning on a daily basis. I really am getting into using Eclipse and want to join the party and start automating my work using Sweave; I am excited for the prospects.

That said, I followed Jeromy's post here and think (keyword, think) that everything is set up correctly. However, since I am very new to LaTex, how can I test it to know that I am up and running and can indeed create pdf's?

Simply, I want to test that my configurations are up and running before I start diving into templates and creating reports. What is the basic process, from within Eclipse, to create a pdf?

Any help will be very much appreciated!

Thanks,

Brock

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹎☆浅夏丿初晴 2024-09-14 08:30:45

是的,假设您在 Eclipse 中使用 StatEt,那么请确保您已完成以下操作;

  • 在Window >下配置的Statet
    偏好? StatEt 和设置
    比如你的 R 环境。
  • 在 Window > 下配置 TexClipse
    首选项> Texclipse,并告诉它
    你的乳胶命令所在的地方(我是
    在 Windows 上,所以这是 c:\program
    files\miktex\miktex\
  • 确保 RJava
    安装在您的 R 中
    环境
  • 设置 R 构建
    配置,转到“运行”>跑步
    配置,单击新建图标
    并输入诸如 R 之类的内容
    环境,工作目录
    以及您想要的任何参数。
  • 设置 Sweave 命令,转到 Run >
    外部工具>外部工具
    配置,单击新图标
    在 Sweave 下,我想我离开了
    一切默认,运行 sweave
    R 控制台并运行 pdflatex

然后创建一个 eclipse 项目,并在该项目中创建一个新的 Sweave 文档,StatEt 应该为您提供一个将成功构建的骨架模板,因此然后打开 R 控制台(从图标或通过 Run > >)运行为),然后选择 Sweave 骨架文档选项卡,运行 Sweave(通过图标,或通过运行 > 外部工具 > 无论您如何称呼它),

然后您应该看到 R 位出现在 R 控制台中,然后Latex'y 位发生在后台,窗口底部有一个小进度条。最终它会完成并弹出一个新的(空白)PDF。

瞧!

我还推荐这个指南 和这个一个

Right, assuming you're using StatEt within Eclipse, then make sure you've done the following;

  • Configured Statet under Window >
    Preferences ? StatEt, and setup
    things like your R environment.
  • Configure TexClipse under Window >
    Preferences > Texclipse, and tell it
    where your latex commands live (I'm
    on Windows, so this was c:\program
    files\miktex\miktex\
  • Make sure RJava
    is installed within your R
    environment
  • Setup the R build
    configuration, goto Run > Run
    Configurations, click the New icon
    and enter things like the R
    environment, the working directory
    and any parameter's you want.
  • Setup the Sweave command, goto Run >
    External Tools > Externals Tool
    Configurations, click the new icon
    under Sweave and I think I left
    everything default, to run sweave in
    the R console and run pdflatex

Then create an eclipse project, and within that project create a new Sweave document, StatEt should give you a skeleton template that will succesfully build, so then open the R console (either from the icon or via Run > Run As), then with your Sweave skeleton document tab selected, run Sweave (either via the icon, or via Run > External Tools > Whatever you called it)

You should then see the R bits occur in the R console, then the latex'y bits happening in the background and a little progress bar at the bottom of the window. Eventually it will finish and a new (blank) PDF will pop up.

Voila !

I'd also recomend this guide and this one

北座城市 2024-09-14 08:30:45

虽然这个问题很久以前就被问到了,但我想我还是分享一下我是如何解决113错误的。基本上,您必须将 R 工作目录更改为工作空间中包含 .Rnw 文件的位置。完成后,Sweave 在我的机器上完美运行。

最好的,托马斯

Although this was asked a long time ago, I thought I would share how I solved the 113 error. Basically you have to change the R working directory to where in your workspace you have the .Rnw file. Once this was done Sweave ran perfectly on my machine.

Best, Thomas

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文