Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Match.call prevents the use of variables #10

Open
reedacartwright opened this issue Oct 25, 2016 · 0 comments
Open

Match.call prevents the use of variables #10

reedacartwright opened this issue Oct 25, 2016 · 0 comments

Comments

@reedacartwright
Copy link

Using match.call in functions doesn't evaluate variables so doing something like this fails:

target_taxon="primates"
homology_id("ENSGblah",target_taxon=target_taxon)

However, using ... to pass optional parameters to sub functions works:

ensembl_homology_id = function (id, return_format, ...) {
    end <- paste("homology/id", id, sep = "/")
    header = rensembl:::ensembl_header(return_format, c("json", "orthoxml", "xml"))
    q <- rensembl:::ensembl_body(list(NA,...), c("id","return_format"))
    req <- rensembl:::ensembl_GET(end, header, query = q)
    httr::content(req)
}

With this implemented, ensembl_body can be improved so you don't need an NA in the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant