I am making a package on R. I have two functions sharing a variable (global).
How to import it into a package?
For instance,
m<-0 f<-function() { m <- m+1 } g<-function() { m <- m-1 }
Yes, and you can export the variable, but you do not need to.
The topic you want to find is “Data in Packages” in the “Writing Extensions” guide.