title: In R, incomplete gamma function with complex input?
body: <p>Incomplete gamma functions can be calculated in R with pgamma, or with gamma_inc_Q from library(gsl), or with gammainc from library(expint). However, all of these functions take only real input.</p>
  
  <p>I need an implementation of the incomplete gamma function which will take complex input. Specifically, I have an integer for the first argument, and a complex number for the second argument (the limit in the integral).</p>
  
  <p>This function is well-defined for complex inputs (see <a href="https://en.wikipedia.org/w/index.php?title=Incomplete_gamma_function&amp;oldid=812912823#Holomorphic_extension" rel="nofollow noreferrer">Wikipedia</a>), and I've been calculating it in Mathematica. It doesn't seem to be built into R though, and I don't see it in any libraries.</p>
  
  <p>So, can anyone suggest a shorter path to doing these calculations, than looking up an algorithm, implementing it in C, and writing an R interface?</p>
  
  <p>(If I do have to implement it myself, here's the only algorithm for complex inputs that I've found: <a href="http://zeta.math.utsa.edu/~gokhman/ftp/papers/igf.pdf" rel="nofollow noreferrer">Kostlan &amp; Gokhman 1987</a>)</p>