自动执行脚本 [英] Automate script execution

查看:71
本文介绍了自动执行脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道如何正确表达,但是:

Not sure how to correctly phrase this but:

假设我有一个 200 行的脚本,我如何自动化"执行以使其停在给定的行(比如 50)处.我可以通过选择来做到这一点,但有时来回切换似乎效率较低.这有捷径吗?!

Say I have a 200-line script, how can I "automate" execution such that it stops at a given line(say 50). I could do this with selection but sometimes going back and forth seems less efficient. Could there be a shortcut to this?!

推荐答案

据我所知,目前还没有这样做的方法(尽管我在这里可能是非常错误的).我想到的一种解决方法是在函数中使用您当前的脚本并使用 stop()-function,因此:

As far as I know there is no current way of doing this (though I could be very wrong here). A workaround I'd think of is using your current script in a function and using the stop()-function, so:

script <- function() {
    ...
    ...
    # when at line 50 (or whereever), use
    stop()
    ...
    ...
}

这篇关于自动执行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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