Using org.rosuda.JRI.REXP objects with R values

Hi,
As JRI and rJava use JNI, I thought I'd try postin this here...
I'm a bit confused about how REXP and Rengine in org.rosuda.JRI works.
If I use the example code....
public REXP getDistance (Rengine re)
         //...open a file and assign some data to 'data'.....then...      
        REXP rexp = re.eval ("dist_out <- data.matrix(data, rownames.force = NA)");
        return rexp;
    }... then the following code knows what 'dist_out' is, that it's of class 'matrix' and works fine...
public Rengine getNJTree (REXP rexp, Rengine re)
        re.eval ("library (ape)");
        re.eval ("tree_mr <- nj(dist_out)");
        re.eval ("plot(tree_mr)");
        System.out.println ("Exiting getNJTree");
        return re;
    }But, if I use....
public Rengine getNJTree (REXP rexp, Rengine re)
        re.eval ("library (ape)");
        re.eval ("tree_mr <- nj("+rexp+")");
        re.eval ("plot(tree_mr)");
       return re;
    }...then I get an error - "object tree_mr not found"
and this is because rexp is not being recognised as the 'dist_out' which was assigned to it earlier.
If I run the code rexp.getContent(), I get the content as "[D@129b0e1", which I guess is some reference?
Even if I try....
{code} public Rengine getNJTree (REXP rexp, Rengine re)
double[][] matrix = rexp.asDoubleMatrix ();
re.eval ("library (ape)");
re.eval ("tree_mr <- nj("+matrix+")");
re.eval ("plot(tree_mr)");
return re;
}{code}
....I still get "object tree_mr not found"
So, I'm obviously doing something wrong here, but I can't figure out for the life of me what it is.
Any help or explaination would be very welcome.
Many thanks!

As JRI and rJava use JNI, I thought I'd try postin this here...I cannot image why. The issue has nothing whatsoever to do with JNI.
Locking this thread.

Similar Messages

  • Using Sparkle build in on object with 0% transparency

    I am trying to use the 'Sparkle' build in on an image (and I have also tried with text) with 0% transparency, so that only the effect is visible.  I have done this in the past in a previous Keynote version.  The issue I am having is that the image shows up not transparent once the build is finished. Any thoughts on what I can do to resolve this? My work around so far is to add 'Disappear' build out after the build in is complete.
    Thanks!

    Use a coloured background
    place a shape on the slide and remove any shadow and use any fill colour
    Reduce the opacity to a value of 0

  • Can I use RMI to find an object with contructor with params?

    Does an RMI available object HAVE to be a parameter-less constructor?
    All the examples I see are:
    MyClass mc = (MyClass) Naming.lookup("/HelloServer");
    Is there any way to pass arguments to its constructor?

    RMI client invokes a remote method on the server object through proxy stub of the server object obtained via Naming service. Stub implements all remote interfaces exported by the RMI server object which basically marshals all the parameters of the remote method, sends the method request to server object skeleton residing in a different address space via TCP connection and finally receives the result from the server object if any, unmarshals and returns result to the caller.
    Server side RMI appilcation instantiates the RMI server class which implements all intended remote interfaces, exports it to the RMI runtime and finally registers itself with Naming service. RMI client only obtains a reference to the RMI server object through lookup method of the Naming service. Remember client does not instantiate a server object, client only knows about the remote interface implemented by the server object and does not have any idea about its implementation object details. On the server sice the Class which implements remote interfaces, can pass any number of arguments to its constructor.
    In your example, MyClass is the stub to the remote server object which implements "MyClass" remote interface. The stub only provides boiler-plate code for remote methods which marshalls params, sends request to RMI server object, receives the result object, unmarshals it and finally returns it to the caller. The stub only contains the necessary information details like remote object ID, host and port to contact the RMI server object which implements the remote interface.
    So client does not instantiate a server implementation objet, it only obtains a reference (stub) to the server object thru Naming service. Remote interface implementation object can declare a constructor which takes any number of arguments. RMI server side application only instantiates this implementation object and registers its stub with the Naming service.
    -- Srinath Mandalapu

  • Do 2 same auth objects with different values bleed together?

    If I had a user who had Auth object F_BKPF_BUK with Activity 01 and Company Code 1200 and also Auth Object F_BKPF_BUK with Activity 03 and Company Code 1300, would the user have 01 and 03 for both Company Code 1200 and 1300 or would the user be restricted to 01 for 1200 and 03 for 1300?

    It depends on the object and how the result of the authority-check is "built".
    For the result of a single authority-check Sanju is correct.
    It would not make sense to attempt to display something (retrieving the value from the record) which has not been created yet (checking the value in the entry screen).
    However the opposite can be true for authority-checks within arguments:
    -  IF weak_check_failed    "user is not authorized...
    -  THEN perform strong_check    "permit everything if passes...
    -  ELSE return_to_...     "Go back to list...
    However, in many cases this weaker : stronger check is against different objects.
    Other transactions will completely bypass the one object and only use a stronger one.
    F_BKPF_BUK should be okay for transactions FB01 and FB03, for example.
    Cheers,
    Julius

  • How to initialize a org.w3c.dom.Node object?

    Hello,
    I want to initialize an org.w3c.dom.Node object with an empty Node.
    How could I do that?
    Thanks
    Sylvain

    I want to create a Document.
    If I test your line, this error appears:
    "Default constructor cannot handle exception type javax.xml.parsers.ParserConfigurationException thrown by implicit super constructor. Must define an explicit constructor."
    Do you know what's happen?
    Thanks
    Sylvain

  • Object with argument constructor in ATG

    HI guys
    Is it possible to craete an object with argument constructor with component in atg
    if it is possible give me an example

    With ATG 10.0.3 and later, you can use an $instanceFactory to create objects with constructor objects or create a Nucleus component from factory (either a static class method, or a method of another Nucleus component).
    Documentation (and an example) are here: http://docs.oracle.com/cd/E36434_01/Platform.10-1-2/ATGPlatformProgGuide/html/s0208parameterconstructorinstancefact01.html

  • Moving distribution list memberships from contact to user object with sync engine

    We only have the FIM sync engine and when replacing an AD contact object with a user object I am being asked to move the distribution lists that the contact is a member of over to the new user object. I've done the contact to user replacement provisioning
    many times before but never had to migrate the group memberships over.
    Does anyone have any advice for the best approach to do this?

    This is what I suspected.  You are not doing conversions.  You are simply Deprovisioning contact and provisioning user. For all intends and purposes, the 2 objects are not related in any shape of form.  So how do you know that this contact
    is related to that user?? 
    What you need is, to have both objects connected at the same time in MV before contact is deprovisioned.  Only this way you know that user 'U' is the same as contact 'C'.  FIM needs to know this.
    For this, you need to have one MV object with 2 AD connectors, one for user and one for contact. You can use to MAs, or you can use code to have one object with 2 connectors.  (Usually this is not allowed, but with code you can pass this)
    Before deprovisioning contact, you do the group membership changes, then you deprovision contact. 
    Nosh Mernacaj, Identity Management Specialist

  • Print or export runtime created vector graphics with alpha values intact

    I want to be able to save the dynamically generated state of a swf as a vector image. I know I can right click on the swf and print to a pdf via the Adobe pdf print driver. This works well but all alpha values are lost. Does anyone know how to print to a pdf or any other vector format and retain the alpha values? The pdf format clearly supports it as I can save objects with alpha values from Illustrator as a pdf no problem.
    Any alternative solution that achives this result would be welcome e.g. save runtime swf via actionscript to swf or Illustrator format etc.
    thanks

    Hi All,
    Flash Pro CC 2014 (v14.0.0.110) is now available for download via the Creative Cloud App and Adobe website.
    We have added SVG Export feature to Flash Pro with this new release. You will now be able to export out vector content from the selected frame as an SVG image that can be opened directly in a Browser and even imported in Adobe Illustrator.
    SVG Export option can be accessed via the Publish Settings as well as via File Menu > Export > Export Image option.
    Along with this, we have added several new features with this release. Complete list is available at these links:
    Overview:         https://www.adobe.com/in/products/flash.html
    Whats new:      https://helpx.adobe.com/flash/using/whats-new.html
    Release Notes: https://helpx.adobe.com/flash/release-note/flash-professional-cc-2014.html
    Thanks,
    Nipun

  • Mass changes of Material Master field with different values

    Hi,
    How to change a field in Material Master for more than thousand materials. I think MM17 can only be used for mass changes of materials with same values. I need to upload different values for different materials. Is there any other way to do this.
    Thanks,
    K R Vishnu Kumar

    Hi Kumar.
    I think you have to use LSMW for mass updation for Material Master fields with different values.
    Regards,
    Rahul.

  • Get width/height or layer bounds with decimals values

    is it possible to retrieve size or bounds of objects with decimal values?
    Thank you

    A shape layer or any other layer with a vector mask could have decimal pixel values if you only want the area defined by the mask.
    But if the paths are curved it might be difficult to determine the extreme values.
    The points’ coordinates are easy enough to determine but determining the most high, left etc. expansion of a curve seems difficult to me.
    The only work-around that I know is calculating a number of points along the path and evaluating those.

  • Can't access object using "id" or "name" if created with actionscript

    How can you register an instance of an object with actionscript so that it's id or name value is accessible?
    I included a simple example where a Button is created using mxml and in the same way it is created using actionscript.  The actionscript object is inaccessible using it's "id" and "name" property.
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                   creationComplete="application1_creationCompleteHandler(event)">
        <fx:Script>
            <![CDATA[
                import mx.events.FlexEvent;
                protected function application1_creationCompleteHandler(event:FlexEvent):void
                    import spark.components.Button;
                    var asBtn:Button = new Button();
                    asBtn.label = "actionscript";
                    asBtn.x = 200;
                    asBtn.id = "asButton";
                    asBtn.name = "asButtonName";
                    addElement(asBtn);
                    trace("mxmlButton="+this["mxmlButton"].label); // returns: mxml  label
                    //trace("mxmlButton="+this["asButton"].label); // returns runtime error: ReferenceError: Error #1069: Property asButton not found on TestId and there is no default value.
                    //trace("mxmlButton="+this["asButtonName"].label); // returns runtime error: ReferenceError: Error #1069: Property asButtonName not found on TestId and there is no default value.
            ]]>
        </fx:Script>
        <s:Button
            id="mxmlButton"
            label="mxml label"
            alpha="0.8"/>
    </s:Application>

    Hi Dan,
    It is a very rare occurrence when I miss not being able to access an object (object property, really) using the ["name"] notation for objects created using actionscript.
    In MXML the compiler is conveniently adding an attribute to the class with the same name as the id, so you can conveniently refer to it using the [] notation. While we explicitly specify an application container to use, the MXML compiler creates a custom container which is a derivative of the base container and to that it adds properties for the children declared in MXML. I guess it also effectively calls "addElement" for us when  the container is being constructed.
    Your example assumes that using "addElement" to add the button to the application container is the same as declaring a variable (ie property ). It isn't, so there's no point in looking for an property of the name "as3Button" using the [] notation, because it doesn't exist. The container is managing a collection of children in it's display list and that's not the same as being accessible as properties of the container.
    Generally speaking, accessing properties using the ["name"] syntax isn't necessary.
    Paul
    [edit: you may wonder why "addElement" doesn't conveniently also add the "id" attribute to be an property of the container class. Unfortunately, it can't because the container class would need to be dynamic and it's not. A further complication would be that adding properties at runtime would invite naming clashes at runtime with associated mayhem. MXML can do this because the compiler generates the class and can trap name duplication at compile time.
    Great question, BTW.
    -last edit changed my "attributes" to be "properties" in line with Adobe's terminology]

  • Objects with IDs not instantiated inside Accordian using SWFLoader

    Flex SDK 3.2.1
    We are using SWFLoader to load one application from another application.
    The second (child) application uses Accordian component which contains datagrid with a specified ID attribute.
    When the code tries to access the datagrid using the specified ID the application throws the following error.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Any help will be greatly appreciated.
    Thank you,
    Srini

    I figured it out!
    For anyone else out there who might be looking for the same effect, here's how you do it:
    1) Create a cool shape with a cool stroke in Illustrator. 
    2) The stroke can be any color, but make sure that the Fill is white (not transparent).
    3) Copy and paste to InDesign. 
    4) Once in ID, the object will apear as a Group.  Go to Object -> Ungroup.
    5) Because the white centre of the object is filled with white, this will apear as one of the items in the group.  It will have it's own object frame. 
    6) Go to File -> Place.  Choose a photo and place it in the frame of the white space.  You'll get a lovely effect that can be manipulated as per usual in ID!

  • Using a polymorphic view object with binding

    Hi,
    I'm hoping there's something simple I'm missing when trying to setup up the bindings for a ADF/struts page using a polymorphic view object.
    I'm using Entity and VO polymorphism to create a Question which has different types - boolean, multi-choice, likert, etc. I have the various question types created as sub type entity and view objects and added to the app module - when added to the app module the question types are subtypes of QuestionView so they don't actually appear in the Data Controls palette. This setup is like that used in Steve Muench's examples (blog at http://radio.weblogs.com/0118231/stories/2003/02/06/constructingTheDesiredEntityInAPolymorphicViewObject.html and the related undocumented one)
    My question is, how do I get to the data and have jdev create the necessary bindings for the extra attributes the subtype questions have? Since they don't appear as available data controls I can't create a binding iterator or anything for them - short of adding them as spearate view objects (which destroys the whole point of using polymorphism in this case) is there a way to do this?
    Really, the only reason I want to use the polymorphism is so I can have different types of entity validation depending on the type. Should I just simplify this to be one entity object with one VO and put all the validation into "if else's" based on a discriminator?
    Assistance appreciated...
    - Nathaniel

    How else are you planning to associate a JUTableBinding to the 'common' iterator containing all four types of rows and then selectively display them? Perhaps you'd need a custom model over the JUTabelModel that'd filter the rows out.
    I'm not sure if all that trouble is worth it given that your datasets (as far as mentioned in this post) are not large. If these tables/data has to be refreshed/executed a number of times, then you may see the overhead of four queries otherwise it should be fine as database is always faster in filtering rows than doing that in memory.

  • Problem in ADF Tree When I use 2 Tree in a Page with same View Object !

    Hi everybody,
    I use JDeveloper 11.1.1.5 and ADF Faces in UI . I have 2 tree in a page that they are from same Updatable View Object but diffrent instances in application module . When I change an attribute value from one of them in manage Bean programmatically , both of them change??!! in my case I put a checkbox in nodeStamp, when user click on checkbox, title of row must change but title in both of them change?????
    I think it is a bug.
    please help me. Thanks

    >
    so what is diffrent to use same view object instances in page or multiple instances when we need ??
    >
    Actually, this depends on your use case. suppose you have a view object with a bind variable, and you want to display to tables on the same page but with different query result depending on the bind variable, in this case you have to create two view instances.
    check
    http://andrejusb.blogspot.com/2011/06/understanding-adf-bc-view-object.html

  • Custom sendemail in sharepoint 2013 designer workflow using dictionary object with email template from list

    I  am looking for custom sendemail in sharepoint 2013 designer workflow using dictionary object with email template from list
    MCTS Sharepoint 2010, MCAD dotnet, MCPDEA, SharePoint Lead

    Hi Greetings.
    pls check if it helps you.
    http://msdn.microsoft.com/en-us/library/office/jj554504(v=office.15).aspx
    Please remember to click 'Mark as Answer' on the answer if it helps you

Maybe you are looking for