0

I'm make a new package in R. In a function of mine, I called get_subnetwork from Package STRINGdb, while function get_subnetwork called function graph.data.frame internally and function graph.data.frame is from another package igraph.

Here I wanted to make package STRINGdb and igraph as imports but not depends in the DESCRIPTION of my new package. When I ran the code, it showed

Error in load() : could not find function "graph.data.frame"
Zeina
  • 59
  • 6
Zhilong Jia
  • 2,329
  • 1
  • 22
  • 34
  • Use `igraph::graph.data.frame` instead of just `graph.data.frame`. – nicola Jul 17 '15 at 15:38
  • @nicola I cannot change the original code of get_subnetwork as graph.data.frame is called internally by get_subnetwork – Zhilong Jia Jul 17 '15 at 15:42
  • @nicola they didn't write the code. Zhilong - the whole "Function A" "Function B" thing only complicates the issue. If you're going to name the functions anyways just describe the situation using the actual function names. – Dason Jul 17 '15 at 15:43
  • @Dason Yes, exactly. Since it involved in a package but not several lines of code, It's not easy to paste the code. – Zhilong Jia Jul 17 '15 at 15:47
  • 1
    @Zhilong You're out of luck until those packages change their imports/depends: http://stackoverflow.com/questions/8637993/better-explanation-of-when-to-use-imports-depends check out the accepted answer – Dason Jul 17 '15 at 15:53
  • What is strange is that STRINGdb depends on igraph. When I just import STRINGdb, it doesnot work. – Zhilong Jia Jul 17 '15 at 16:00
  • 3
    That's not strange - that's exactly what the answer says "There is one unfortunately common exception to the advice above: if your package relies on a package A which itself "Depends" on another package B, your package will likely need to attach A with a "Depends directive."" – Dason Jul 17 '15 at 16:20

0 Answers0