RStudio 错误:意外符号(无法找到) [英] RStudio Error: Unexpected Symbol (That Can't Be Found)

查看:148
本文介绍了RStudio 错误:意外符号(无法找到)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有敏锐眼光的人可以帮助我.当我运行下面的两个代码块时,第一个块运行良好:

Hoping someone with a sharper eye can help me out. When I run the two blocks of code below, the first chunk goes fine:

add.rule(strategy.st, name = "ruleSignal",
         arguments = list(sigcol = "exitLongNormal",
                          sigval = TRUE,
                          orderqty = "all",
                          ordertype = "market",
                          orderside = "long",
                          replace = FALSE,
                          prefer = "Open",
         type = "exit", path.dep = TRUE, label = "normalExitLong")

add.rule(strategy.st, name = "ruleSignal",
         arguments = list(sigcol = "exitLongFilter",
                          sigval = TRUE,
                          orderqty = "all",
                          ordertype = "market",
                          orderside = "long",
                          replace = FALSE,
                          prefer = "Open",
        type = "exit", path.dep = TRUE, label = "filterExitLong")

运行时初始块给了我这个:

When ran the initial block gives me this:

> add.rule(strategy.st, name = "ruleSignal",
+          arguments = list(sigcol = "exitLongNormal",
+                           sigval = TRUE,
+                           orderqty = "all",
+                           ordertype = "market",
+                           orderside = "long",
+                           replace = FALSE,
+                           prefer = "Open",
+          type = "exit", path.dep = TRUE, label = "normalExitLong")

然而,第二块是问题孩子,运行时我得到以下信息:

Block two however, is the problem child, when ran I get the following:

Error: unexpected symbol in:
"         type = "exit", path.dep = TRUE, label = "normalExitLong")
add.rule"

这似乎很容易找到,但对于我的生活,我就是无法弄清楚.提前感谢您的任何意见.

It seems like this would be something pretty simple to find, but for the life of me I just can't figure it out. Thanks in advance for any input.

推荐答案

这是不匹配的括号:

add.rule(strategy.st, name = "ruleSignal",                          # OPEN
         arguments = list(sigcol = "exitLongNormal",                # OPEN
                          sigval = TRUE,
                          orderqty = "all",
                          ordertype = "market",
                          orderside = "long",
                          replace = FALSE,
                          prefer = "Open",
         type = "exit", path.dep = TRUE, label = "normalExitLong")  # CLOSE

这篇关于RStudio 错误:意外符号(无法找到)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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