When the vector N passed to R_ldsc contains only integers (i.e. class(N) == "integer"), the function fails due to the following code snippet:
if("matrix" %in% class(N)){ stopifnot(nrow(N) == J & ncol(N) == M) }else if(class(N) == "numeric"){ stopifnot(length(N) == M) N <- matrix(rep(N, each = J), nrow = J) }
N remains a vector instead of a matrix, which causes the following error:
Error in map2():
In index: 1.
Caused by error in N[ix, i]:
! incorrect number of dimensions