意外"("嵌套ifelse R

时间:2015-08-15 15:04:53

标签: r rstudio

我正在尝试在R

中运行以下代码行
new <- data.frame(newdb, 
                ifelse(newdb$centile >=0 & newdb$centile < 3,"1",
                ifelse(newdb$centile >=3 & newdb$centile < 6,"2",
                       ifelse(newdb$centile >=6 & newdb$centile < 9,"3","4"))))

但是我收到以下错误

  

错误:意外&#39;)&#39; in&#34; ifelse(newdb $ centile&gt; = 6&amp; newdb $ centile&lt;&gt; 9,&#34; 3&#34;,&#34; 4&#34;))&#34;

0 个答案:

没有答案