How do you use “<<-” (scoping assignment) in R?

后端 未结 6 1214
别跟我提以往
别跟我提以往 2020-11-22 11:16

I just finished reading about scoping in the R intro, and am very curious about the <<- assignment.

The manual showed one (very interesting) examp

6条回答
  •  长发绾君心
    2020-11-22 11:27

    One place where I used <<- was in simple GUIs using tcl/tk. Some of the initial examples have it -- as you need to make a distinction between local and global variables for statefullness. See for example

     library(tcltk)
     demo(tkdensity)
    

    which uses <<-. Otherwise I concur with Marek :) -- a Google search can help.

提交回复
热议问题