R:为什么()和{}无法控制解析的操作顺序?

为什么这样做:

tb4 <- names(tibble(c("O","H","L","V","P")))
names(tb4)<-"nms4"
str(tb4)
 Named chr "c(\"Open\",\"High\",\"Low\",\"Volume\",\"prev_day_open_int\")"
 - attr(*,"names")= chr "nms4"

但不是这样:

tb3 <- {names(tibble(c("O","P")))<- "nm3"}
Error in names(tibble(c("Open","High","Low","Volume","prev_day_open_int"))) <- "nm3" : 
  target of assignment expands to non-language object.

还是这个?

tb3 <- (names(tibble(c("O","P")))<- "nm3")

相同的错误。

wyuan123 回答:R:为什么()和{}无法控制解析的操作顺序?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2919495.html

大家都在问