R:GUI可以快速启动(替代光泽吗?) [英] R : GUIs fast to launch (alternatives to shiny ?)

查看:70
本文介绍了R:GUI可以快速启动(替代光泽吗?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我的CRAN软件包制作一些GUI

I am trying to make some GUI for my CRAN package

  1. 一些f函数,该函数在本地启动带有一些参数的弹出窗口,这些弹出窗口呈现一些输出,例如在本地启动一个简单的闪亮应用程序.
  2. 弹出窗口允许容易地选择参数,然后在窗口中验证".按钮触发具有选定参数的f返回,例如stopApp闪亮
  1. some f function that locally launches a popup with a few params rendering a few outputs, like launching locally a simple shiny app.
  2. the popup permits to select the parameters easily and then a "validate" button triggers the return of fwith the selected parameters, like shiny with stopApp

我已经通过闪亮完成了该操作,但是我认为结果有点令人不满意,因为闪亮的应用程序启动和停止速度很慢(如果我猜有序列化的对象).

I have already done that with shiny but i think the result is a bit unsatisfying because shiny apps are slow to launch and stop (if there is an object to serialize i guess).

我已经看到有些软件包,例如vdiffr,似乎通过列出要更改的对象来解决此问题,因此它们只启动一次即可使用某些选择器更改所有内容.如果可能的话,我想避免这种解决方案.

I have seen that some packages, like vdiffr, seem to answer this problem by making a list of the objects to change, thus they only launch shiny once to change everything with some selecter. If possible I'd like to avoid this solution.

所以问题是:是否有某种GUI框架比Shiny更为方便(仅本地,快速启动和快速返回)?或做某件事的一种好方法,那就足够轻(我不想让我的包裹对于一个小的弹出窗口来说就显得特别沉重)?

So the question is : is there some kind of GUI framework more convenient than Shiny for this (only local, fast launch and fast return) ? Or some fine way to do that, that is light enough (I don't want to make my package to be extraordinary heavy for a small popup) ?

推荐答案

以下是R附带的GUI工具(不需要软件包):

Here are GUI facilities that come with R (no packages needed):

(1)对于足够简单的应用程序,可以使用select.listmenureadlinefile.choosechoose.dir,并会根据用户所处的环境显示文本或图形用户界面.这些都带有R,并且启动非常快,并且易于编程.请参阅这些命令的帮助页面,然后尝试:

(1) For sufficiently simple applications select.list, menu, readline, file.choose and choose.dir can be used and will present with a text or graphical user interface depending on what environment the user has. These all come with R and launch very quickly and are easy to program. See the help pages of those commands and try:

select.list(c("oranges", "apples", "pears"))
menu(c("oranges", "apples", "pears"))
readline("Enter name of fruit: ")
choose.dir()
file.choose()

(2)tcltk程序包是一种能够像闪亮的用户界面那样复杂的功能.它是R附带的,因此不需要安装.它只需要使用library语句加载. (如果用户从源代码构建R,则可以在没有tcltk功能的情况下进行构建,但是在所有情况下99%的tcltk都会存在.)

(2) A possibility which is capable of user interfaces as sophisticated as shiny is the tcltk package. This comes with R so it does not need to be installed. It only needs to be loaded using a library statement. (If a user builds R from source then it is possible to build it without tcltk capability but in 99% of all cases tcltk will be present).

这里有一些使用tcltk的R源代码的简短示例: https://www.stat.berkeley.edu/~s133/Gui-a.html ,并且可以运行Rcmdr R程序包以查看复杂的tcltk用户界面的示例,尽管加载时间比加载时间更长.体积大,简单的应用程序.

There are a few short examples of R source code employing tcltk here: https://www.stat.berkeley.edu/~s133/Gui-a.html and one can run the Rcmdr R package to see an example of a sophisticated tcltk user interface although that will take longer to load than a simple application due to its large size.

由于tcltk是R本身的一部分,因此它没有CRAN页,但是对于使用tcltk的其他软件包,请在其

Because tcltk is a part of R itself it does not have a CRAN page but for additional packages that use tcltk look at the reverse dependencies of the tcltk2 package at the bottom of its CRAN page since any package that depends on it must also use tcltk.

这篇关于R:GUI可以快速启动(替代光泽吗?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆