1

I am using the following:

qicout <- matrix(unlist(lapply(X = cand.set, FUN = qic)), length(cand.set), 4, byrow = TRUE)

It has worked, but I have changes the function qic so it now has an argument

qic(model, small = TRUE)

I would like to adjust the lapply function above to include TRUE or FALSE within qic. This lapply function to calculate qicout is actually within another function and I would like to have an option of small = TRUE/FALSE so it can be passed to the qic function within lapply. Any suggestions of the best way to do this?

djhocking
  • 1,072
  • 3
  • 16
  • 28

1 Answers1

4

I think:

cout <- matrix(unlist(lapply(X = cand.set, FUN = qic, small = TRUE )), 
    length(cand.set), 4, byrow = TRUE)

should work or small = FALSE but I may not understand correctly.

Tyler Rinker
  • 108,132
  • 65
  • 322
  • 519
  • +1 [similar for the whole family](http://stackoverflow.com/questions/12792896/passing-arguments-to-iterated-function-through-apply) – Anthony Damico Dec 20 '12 at 07:15
  • Thank you. That worked perfectly. I kept trying to add the small argument inside parentheses like FUN = qic(small = FALSE) and things like that. – djhocking Dec 20 '12 at 14:25