Pseudospectra of Non Square Matrices in R implementation

Rectpsa = function(A,grid){
  m = nrow(A)
  n = ncol(A)
  if (m >=2*n){
    QR <- qr(A[n+1:m,])
    Q  = qr.Q(QR)
    R  = qr.R(QR)}
  I = diag(nrow(n))
  else ...
}
A = matrix(c(0, 2, 2,4,
             0, 1, 2,4,
             1, 0, 1,4,
             0, 2, 2,4,
             0, 1, 2,4,
             1, 0, 1,4,
             0, 1, 2,4,
             1, 0, 1,4),8,4,byrow =TRUE)
A
z = seq(1,10,0.001)*1i

But my knowledge in R comes only with this.Any help?

An implementation in Python could be run under R using {retriculate}. I have no experience with the algorithm, however.