什么是bash的在devtools包吗? [英] What does bash in the devtools package do?

查看:186
本文介绍了什么是bash的在devtools包吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在响应previous问题,<一个href=\"http://stackoverflow.com/questions/7169202/alternatives-to-system-in-r-for-calling-sed-rsync-ssh-etc-do-functions-exis\">Alternatives在R系统()调用SED,rsync的,SSH等:做功能存在,我应该写我自己的,还是我错过了点?,的哈德利的 <一个href=\"http://stackoverflow.com/questions/7169202/alternatives-to-system-in-r-for-calling-sed-rsync-ssh-etc-do-functions-exis/7746296#7746296\">answer指出,当遇到类似的问题,他用了一个类似的功能:

In response to a previous question, Alternatives to system() in R for calling sed, rsync, ssh etc.: Do functions exist, should I write my own, or am I missing the point?, hadley's answer indicated that when faced with a similar problem, he had used a function like:

bash <- function() system("bash")

我发现在他的devtools包中的原件; 在devtools执行/ R / bash.R

#' Open bash shell in package directory.
#'
#' @param pkg package description, can be path or package name.  See
#'   \code{\link{as.package}} for more information
#' @export
bash <- function(pkg = NULL) {
  pkg <- as.package(pkg)

  in_dir(pkg$path, system("bash"))
}

<击>
我不明白这一点。当我发出

I don't understand the point of this. When I issue

bash <- function() system("bash")

这向我发送到bash shell中,之后,退出返回我的R会话,但没有庆典功能。看来,我可以通过:发出以下命令对(R中第一个命令,第二在bash)

It sends me to the bash shell, after which exit returns me to the R session, but there is no bash function. It seems that I can get the same effect by either issuing either of the following command pairs (first command in R, second in bash)

system('bash')
exit

q('yes')
R


删除线的部分是因为对我而言

我也找不到在devtools包中的庆典函数中的任何进一步使用

I also can not find any further uses of the bash function in the devtools package

有人可以帮助我了解如何使用庆典功能可以使用;可它的上下文(例如,在脚本或函数)比交互式R模式下其他人用?

Can someone please help me understand how the bash function could be used; can it be used in contexts (e.g. within scripts or functions) other than interactive R mode?

推荐答案

早期版本 devtools 中包含了一些功能,以推/拉code与git / github上。这个现在已经去precated。

Earlier versions of devtools included some functionality to push/pull code to git/github. This has now been deprecated.

相反,方便的功能庆典只是打开包目录一个bash编辑器。这意味着你可以使用命令行工具来使用Git / GitHub的交互。

Instead, the convenience function bash simply opens a bash editor in the package directory. This means you can use command line tools to interact with git/github.

庆典的目的只是为了节省几个按键来打开包目录的命令行。它用于任何其它功能。

The purpose of bash is simply to save a few keystrokes to open the command line in the package directory. It serves no other function.

这篇关于什么是bash的在devtools包吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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