0

I have a R function with following header:

getFileNames <- function(sex=NULL,species=NULL,name=NULL){

When I call it like this, all is fine:

getFileNames(sex="F",species="Pan paniscus")

However, I would like to call it with variable filters like this:

getFileNames(filters)

Now I am trying to figure out how to define filters. I have tried

filters<-paste("sex=F","species=Pan paniscus",sep=",")

with no success.

0

1 Answer 1

1

The best you can do is to use do.call :

filters = list(sex="F",species="Pan paniscus")
do.call(getFileNames, filters)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.