Robert
Robert

Reputation: 5152

How to view the code when no method/function is visible?

This question is similar to this. I am trying to figure out what the function does, but I still cannot see the source code of SharpeR:::as.markowitz. I tried, without success:

getAnywhere("as.markowitz")
  getS3method("as.markowitz")
  methods("as.markowitz","SharpeR")
  methods(class="as.markowitz")
  methods("as.markowitz")

Is there other ways to see the source?

Upvotes: 0

Views: 37

Answers (1)

Kamil Bartoń
Kamil Bartoń

Reputation: 1562

This is because methods for as.markovitz are not registered properly in the package namespace. Normally, this should work:

with(asNamespace("SharpeR"), methods("as.markowitz"))

Use ls to list all the functions in the package, and get to show the code:

ls(asNamespace("SharpeR"), all = TRUE)
get("as.markowitz.default", asNamespace("SharpeR"))

Upvotes: 1

Related Questions