I modified an R-Package (gbp) for college and some functions only work if I load them manually.
I tried putting all functions in one script and creating one script for each function. I wrote all functions in the namespace file (export ("function")). I also tried to create one package for each function, but none of it worked.
testfunction1 <- function (sn)
{
it <- sn[["it"]]
it <- it[, list(oid = get("oid"), otid = get("otid"), bid = get("bid"),
id = get("sku"), x = get("x"), y = get("y"),
z = get("z"), l = get("l"), d = get("d"),
h = get("h"), w = get("w"))]
}
For example, when trying to execute this function, it says "object 'oid' not found". sn is a list which I give to the function and sn$it contains all those referred columns("oid", "otid", "bid", ...).
There were several errors, but anything worked fine when I loaded each function manually, so I think the problem is something general.
I would appreciate any help.
Edit: I solved the errors step by step by changing each operation which led to an error. But I still don't know why there are functions which only work when loaded manually but not when integrated in my package.