I am making a package on R. I have two functions sharing a variable (global).
我在r上做了一个包,我有两个函数共享一个变量(全局)。
How can I import it to the package?
如何将其导入到包中?
For example,
例如,
m<-0
f<-function() { m <- m+1 }
g<-function() { m <- m-1 }
1 个解决方案
#1
3
Yes, and you can export the variable, but you don't have to.
是的,你可以导出变量,但你不需要。
The topic you want to look up is "Data in packages" in the "Writing Extensions" manual.
您想要查找的主题是“编写扩展”手册中的“包中的数据”。
#1
3
Yes, and you can export the variable, but you don't have to.
是的,你可以导出变量,但你不需要。
The topic you want to look up is "Data in packages" in the "Writing Extensions" manual.
您想要查找的主题是“编写扩展”手册中的“包中的数据”。