natverse / nat.nblast

R package implementing the NBLAST neuron search algorithm, as an add-on for the NeuroAnatomy Toolbox (nat) R package.
http://natverse.org/nat.nblast/
17 stars 6 forks source link

nblast fails to find smat.fcwb if nblast package is not attached. #31

Open jefferis opened 8 years ago

jefferis commented 8 years ago

If using nblast inside another function when importing but not attaching nat.nblast

from elmr package.

 get(smat) 
2 nat.nblast::nblast(xdp, db, normalised = normalised, .parallel = .parallel, 
    ...) at nblast_fafb.R#64
1 nblast_fafb(27884, mirror = FALSE) 

workaround is to attach. Fix will involve something to do with scope of get statement (being pointed to objects in package)

jefferis commented 8 years ago

@ajdm ping (but not actually required for the revision per se)

jdmanton commented 8 years ago

I had a look yesterday but failed, but will try and get it done this weekend.

jdmanton commented 8 years ago

So far I've tried @importFrom tags in nblast, etc., using get("smat.fcwb", envir=as.environment("package:nat.nblast")) and get("smat.fcwb", envir=asNamespace("nat.nblast")), and none of these work. It seems you can see functions that aren't exported, but not data. Adding an @export tag to the data objects doesn't work either. Any ideas?

jefferis commented 8 years ago

Hmm. There are some ideas here: http://stackoverflow.com/questions/24354850/load-data-object-when-package-is-loaded

Sent from my iPhone

On 15 May 2016, at 17:10, James Manton notifications@github.com wrote:

So far I've tried @importFrom tags in nblast, etc., using get("smat.fcwb", envir=as.environment("package:nat.nblast")) and get("smat.fcwb", envir=asNamespace("nat.nblast")), and none of these work. It seems you can see functions that aren't exported, but not data. Adding an @export tag to the data objects doesn't work either. Any ideas?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub