As公式中的意外符号无法找到

rid*_*994 1 string text r formula syntax-error

我一直在使用as.formula设置glm,我无法弄清楚意外符号的位置.部分问题是我转换的字符向量太长了.+插入其间约700个单词,以便将其转换为公式.错误如下:

Error in parse(text = x, keep.source = FALSE) : 
   <text>:2:10080: unexpected symbol
Run Code Online (Sandbox Code Playgroud)

使用以下文本片段:

2: c_1_E + Campaign_Search_Payroll_Generic_1_P + Campaign_Search_Performing_Core_Keywords + Campaign_Self_Employment_E + Campaign_Self_Employment_P + Campaign_Withholding + Campaign_Youtube + Sou
Run Code Online (Sandbox Code Playgroud)

我确切知道的事情:

  1. 没有项目重复.
  2. 除了字母数字和下划线(_)之外没有其他符号.
  3. 没有项目以数字开头.

我在R中不够精通,无法理解阅读文档as.formula或函数调用本身.

有任何想法吗?

Bro*_*ieG 5

<text>:2:10080是给你错误的位置.第2行,第10080个字符.考虑:

parse(text="1 + 1 + 2\n a - 3 b")
# Error in parse(text = "1 + 1 + 2\n a - 3 b") : 
#   <text>:2:8: unexpected symbol
Run Code Online (Sandbox Code Playgroud)

这里,错误是b,这是非法使用符号,你会注意到它是第二行的第8个字符.

很可能你错过了一个+,但没有你错误背后的数据就无法知道.此外,不要判断或任何东西,但这是一个很大的变量,坚持模型.我希望你有很多数据点.