When trying to run champ.SVD() on my beta-matrix, I get the following error:
Error in if (class(beta) == "data.frame") { :
the condition has length > 1
I have read here that it is because since R 4.0.0, numeric matrices have two classes ("matrix" and "array"), so champ.SVD() returns an error, as it check whether the class is equal to a particular value. Can you fix the code with something like:
if (inherits(matrix_obj, "matrix"))
Hi,
When trying to run champ.SVD() on my beta-matrix, I get the following error: Error in if (class(beta) == "data.frame") { : the condition has length > 1 I have read here that it is because since R 4.0.0, numeric matrices have two classes ("matrix" and "array"), so champ.SVD() returns an error, as it check whether the class is equal to a particular value. Can you fix the code with something like:
if (inherits(matrix_obj, "matrix"))
Thank you in advance!
Sarah