Hi all, I'm writing a lib, but then I found something pretty weird, some cases the element does not exists, so:
In a empty lib do the next thing.
R/def.R
a <- 10
R/cpp.R
b <- a
Now, when you do devtools::load_all("."), you will get:
object 'a' not found
But, if you rename cpp.R to set.R then it will works.
What I think about this, is that R loads the files from R/* in alphabet order, causing to call first cpp.R and then def.R, how a does not exists sends an error.
Can you explain a bit why you want to have non-function objects exported? My impression is that this is not really something you'd do with packages, there are various ways to store and load data, and you'd typically want to be explicit, for example by storing it in the "data/" directory.
Hi, I'm actually using a library called "typed", it helps to set types of vars and return functions, the problem is the order of execution of the R files, because a single definition, like "a dataframe with this column" is defined, then used in several files and functions, how they are called when the function is created, request to first exist the declaration....
Need a way to force R to read first a file, to then continue loading the next one in the lib.