Creating contingency table when OR, p-value known

  1. what are the ‘c(10, 10, 10, 10)’ and ‘target’ parameters for?

These are the starting values for the algorithm, the initial guess for the values. Consult the documentation for the function to see what each argument does.

  1. with the given set of data, will the solution derived always be the only solution i.e. is it possible that a solution with some other combination of values gives the same OR?

For each dataset, there are two possible sets of solutions, but one results in negative numbers which are of course not sensible in this context. The formulas I provided should provide a unique positive result. I have not studied that in depth, though. I tried a few examples and all results were sensible.