r - Specify function parameters in do.call -


lets have function fetches data yahoo called yahoo.fetch, , run do.call on function, be:

do.call(merge.xts, lapply(list.of.tickers, yahoo.fetch)) 

the default have all=true in merge.xts, how able specify in do.call have all=false? example, know how change , specify parameters in apply, do.call, lapply functions.

you can add named value existing list c() returns list:

do.call(merge.xts, c( lapply(list.of.tickers, yahoo.fetch), all=false )) 

or wrap parameter in anonymous helper function:

do.call( function(x) merge.xts(x, all=false),                 lapply(list.of.tickers, yahoo.fetch)) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -