Take the 2-minute tour ×  Assume I have two different parameter
vectors used as inputs in a function. Also, assume the two
parameter vectors are of different lengths. Is there a way to
output all the possible values of that function? I know that if
I use two parameter vectors of different lengths, then the
shorter parameter vector is just repeated so that doesn't work.
I can solve this "manually" as you can see below. But, I'd like
to find a more efficient manner of calculating all the possible
combinations. An example follows:  Assume I'm using the dbinom()
function that has as inputs x (number of "successes" from the
sample), n (number of observations in the sample), and p (the
probability of "success" for each x). n stays constant at 20;
however, my x varies from 7,8,9,...,20 ("x7" below) or 0,1 ("x1"
below). Also, I want to evaluate dbinom() at different values of
p, specifically from 0 to 1 in .1 increments ("p" below). As you
can see the three parameter vectors x7, x1, and p are all of
different lengths