Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java interop with R error? #210

Open
ravinder387 opened this issue Dec 22, 2022 · 2 comments
Open

java interop with R error? #210

ravinder387 opened this issue Dec 22, 2022 · 2 comments
Labels

Comments

@ravinder387
Copy link

I write a methods on double[][] type in java. when i add this class to R it gives me internal error. what's correspondence R data type to java data type
Screenshot from 2022-12-18 21-03-50

@steve-s
Copy link
Member

steve-s commented Jan 2, 2023

Hello @ravinder387,

could you please also include the Java code of MatrixSqrt?

@ravinder387
Copy link
Author

public class Array2D {

public double[][] jsqrt(double[][] vec) {
    // output
    double[][] output = new double[vec.length][vec[0].length];
    
    // iterate col-wise
    for (int i = 0; i < vec.length; i++) {
        for (int j = 0; j < vec[0].length; j++) {
            output[i][j] = Math.sqrt(vec[i][j]);
        }

    }
    
    // return
    return output;
   
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants