Set operators over ore.frame

Is there a way to make set operators work with ore.objects without ore.pull?
EXAMPLE:
> df1 <- data.frame(ID=c(1:3),A=rep(1,3))
> df2 <- data.frame(ID=c(2:4),B=rep(1,3))
> class(df1)
[1] "data.frame"
> # Union
> union(df1$ID,df2$ID)
[1] 1 2 3 4
> # Minus
> setdiff(df1$ID,df2$ID)
[1] 1
> #Intersect
> intersect(df1$ID,df2$ID)
[1] 2 3
> #-------------------------------------------------
> of1 <- ore.push(df1)
> of2 <- ore.push(df2)
> class(of1)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> # Union
> union(of1$ID,of2$ID)
integer(0)
> # Minus
> setdiff(of1$ID,of2$ID)
integer(0)
> #Intersect
> intersect(of1$ID,of2$ID)
integer(0)
> #-------------------------------------------------
> vec1 <- ore.push(df1$ID)
> vec2 <- ore.push(df2$ID)
> class(vec1)
[1] "ore.integer"
attr(,"package")
[1] "OREbase"
> union(vec1,vec2)
integer(0)

Many of the commonly used base R functions are overloaded in the Oracle R Enterprise transparency layer to work with ore.frame objects.  These functions are located in the OREbase and OREstats packages.
For example, to get the union, use merge, as it has been overloaded to operate on ore.frame objects:
R> find("merge")
[1] "package:OREbase" "package:base"  
merge(x = of1, y = df2, all = TRUE)
R> merge(x = of1, y = of2, all = TRUE)
ID  A  B
1|NA  1  1 NA
2|1   2  1  1
3|2   3  1  1
NA|3  4 NA  1
to subtract:
R> find("Arith")
[1] "package:OREbase" "package:methods"
of1$A - of2$B
R> of1$A - of2$B
[1] 0 0 0
There is no need to pull the data if the function is overloaded to work with ore.frame objects.  More examples can be found in the ORE 1.4 Training Materials: Oracle R Enterprise 1.4 Transparency Layer: http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/learnmore/ore-1-4-transparency-layer-215…
You can view the functions in the OREbase and OREstats packages by typing:
ls("package:OREbase")
ls("package:OREstats")
Sherry

Similar Messages

  • Set z-order of Frames

    Hi, I have an application that has a lot of open Frames, and one main control bar frame. (Looks like an old Macintosh app, with windows all over the place.) When I'm using this app in windows, and switching back and forth between other apps, the windows associated with this app get "lost", ie hidden behind other frames.
    What I'd like is when the user activates the control bar frame, it brings all other frames to front, followed by the control bar frame. So I wrote a window listener for the control bar Frame, see below. But it's not working, because apparently the windowActivated event sometimes happens after the bringFramesToFront method is called and sometimes not; when it does, the Frames fight each other for focus. The other problem is that, even when this works, the Frames come up in apparent random order. I'd like them to maintain thier z-order with respect to each other, but be on top of all my other windows.
    Is there an easier way to get/set z-order for Frames in Java? Note, I am stuck using Frames and not JFrames because of legacy issues.
    boolean ignore=false;
    // I tried this with windowGainedFocus also, with the same result
    public void windowActivated(WindowEvent e)
    if (!ignore)
    bringFramesToFront();
    private void bringFramesToFront()
    ignore = true;
    Frame[] frames = Frame.getFrames();
    for (int i = 0; i < frames.length; i++)
    if (frames[i] != this)
    frames.toFront();
    toFront();
    ignore = false;
    // even though I called toFront() before setting ignore to false,
    // sometimes a new windowGainedFocus event is received after
    // this function exits.

    The reason they come up in random order is because when you call Frame.getFrames() it returns an array with the order they were (created)? and not the z-order. So you have to remember the z-order yourself.
    You can do this using a frame manager. Basically, when you create one of your frames, you register it with the manager. Then anytime you need the z-order, you can ask the frame manager.
    When the frame is registered, the frame manager adds it to it's queue of frames, and adds a WindowListener to it. It uses the window listener to listenen for activated, and closed events.
    When it hears an activated event, it puts that frame at the front of its queue and pushes the other frames one position back, and when it hears a closed event, it removes that frame from the queue.
    So when you want to know the z-order of the frames, ask the frame manager and it will return an array of the items in its queue.
    Also, you will need to consider how to handle minimized frames(?). Good luck.

  • What is use of set operators in OBIEE

    Hi Guys,
    Colud you please tell me what is main use of Set Operators (Intersection,Union,Union all)in OBIEE.
    Is it mandatory to use them in reports?
    Pls tell me.
    Regards,
    siva

    Hi,
    What scenario we are using set operators.
    For Eg.
    Col 1 is having values:
    A
    B
    C
    Col 2 is having values:
    1
    2
    3
    I have to create a new column in answers having values
    A
    B
    C
    1
    2
    3
    solution:
    You can use SET operators in OBIEE and it's really easy to set it in answers section. So create one request and then add other similar request to it by using UNION operator.
    or
    we can use case statement also.
    2. Is it mandatory to use them in reports?
    Normal reports not mandatory.
    Hope it helps.
    Thanks,
    satya

  • How to convert a table exists in db into an ore.frame object ?

    Hi:
    I can get the "ore.frame "object that is returned by ore.ls() while have created by ore.create(),but I want to make a table in db as "ore.frame" object and I can operate it in R console.But how?
    thanks very much.

    Let's say you have a table <tt>FOO</tt> in the same schema that you used to <tt>ore.connect</tt> to. To get it as an <tt>ore.frame</tt> object:
    ore.sync(table = "FOO")
    ore.attach()

  • I bought my iPad in USA. It was set up over there.i live in Ireland.when I try to buy from apple store it doesn't accept my details and says I must put in my USA address.can this be changed?

    I bought my iPad in USA. It was set up over there.i live in Ireland.when I try to buy from apple store it doesn't accept my details and says I must put in my USA address.can this be changed?

    Walk it into the nearest Apple Store there in Ireland, admit you purposely avoided buying it there, and ask them to help you sort it out. I'm sure they'll be happy to service your overseas purchase.....

  • Creating measure using set operators in BO Xi 3.0

    Hi All,
    I am trying to create a measure like this in BO XI 3.0 Designer.
    Select count(*) from
    select id from table1 where Name=<Prompt Value>
    INTERSECT
    select id from table1 where Name=<Prompt Value>
    But I don't know how to use set operators in Designer.
    Can someone please help or any pointer would help.
    Thanks,
    Kuldeep
    Edited by: Kuldeep Chitrakar on Apr 2, 2009 4:06 PM

    Create a derived table with same SQL and drag the table into universe pane to create object.

  • Set operators in PLSQL

    Hi All,
    Can we use set operators in PLSQL. I hope we can not use it in PLSQL. But just wanted to check with you all.
    Begin
    select 1 into n from dual
    union
    select 2 into n from dual;
    end;
    Thanks

    Not using that syntax you won't in PL/SQL as it's just wrong.
    As you're querying multiple rows you'd have to either loop or collect it in to a collection e.g.
    SQL> declare
      2    type aNums is table of number;
      3    vNums aNums;
      4  Begin
      5    select n
      6      bulk collect into vNums
      7    from
      8      (
      9      select 1 as n from dual
    10      union
    11      select 2 from dual
    12      );
    13  end;
    14  /
    PL/SQL procedure successfully completed.
    But yes, you can use any SQL statements in SQL that you use in PL/SQL.

  • Can you set up a key frame on a movie published through iPhoto on .Mac?

    Does anybody know if you can set up a key frame on a movie published through iPhoto on .Mac? I mean the thumbnail for the movie...

    lnbs:
    Welcome to the Apple Discussions. Not in iPhoto. I don't know if you can import the movie into iMovie and set a key frame that way. But that would include some additional encoding to get it out of iMovie and might degrade the quality.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. It's compatible with iPhoto 08 libraries. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Set Operators - Clarification needed

    This is my query. I am executing this in HR Schema Oracle 11g.
    SELECT HIRE_DATE, EMPLOYEE_ID, to_char(null) FROM EMPLOYEES WHERE LAST_NAME='Taylor'
    UNION ALL
    SELECT SYSDATE, TO_CHAR(NULL), 1+1 FROM DUALIt gives ORA-01790: expression must have same datatype as corresponding expression error. What data type is mismatching here? I don't seem to understand. HIRE_DATE and SYSDATE - DATE data type. Is something wring with my other two columns? I read that TO_CHAR(NULL) can be used for filling missing values. That's why I tried this way.
    Any guidance, please?

    Hi,
    whenever you use set operators there has to be ont to one datatype correspondance of the columns you define in all the select statements.
    Here the first select statement's employee_id number is conflicting with to_char(null) and to_char(null) is conflicting with 1+1.
    Hence try out this
    SELECT HIREDATE, Empno, to_char(null) FROM EMP WHERE ename='Taylor'
    UNION ALL
    SELECT SYSDATE, 1+1,TO_CHAR(NULL) FROM DUAL
    or use
    SELECT HIRE_DATE, EMPLOYEE_ID, to_NUMBER(null) FROM EMPLOYEE WHERE LAST_NAME='Taylor'
    UNION ALL
    SELECT SYSDATE, TO_NUMBER(NULL), 1+1 FROM DUAL

  • Flash CC to canvas and spreading code over several frames

    I know about the relationship between flash and CreateJS, and I know that I could step away from the flash interface for A LOT of what I'm after and simply use it to create a nifty library of assets and have all my javascript as external files. That's not what I'm after (although using a text editor with proper syntax highlighting would be wonderful!). I wish to keep as much of my workflow as possible inside of the Adobe Flash CC interface.
    The question comes in two parts, the second being a followup question:
    1) Where I before used to save code in external as files, since now the external javascript gets created (combined) when publishing the flash project, I thought I'd better keep all my code inside of flash. Is this a mistake? I'm after ease of use and keeping my projects structured.
    2) If I keep my code inside of flash I'd never nest it in movieclips. I'd keep it all on the main timeline strictly. Back in the golden flash days for decent but smaller apps I'd put general helper functions and imports on the first frame, then maybe some preloading graphics on frame 2 with minimal code for that. Finally "the app" on frame 3 with more specific code to manage the interface. This made everything load quickly and I could spread the app functionality naturally over a few frames to make it easier to visualise and manage. But exporting for canvas/javascript I can't even get code on one layer to recognise the functions on another. Do I really need to scope main timeline functions on creation to get it to work?
    I'm really after basic advice on workflow and project structuring.
    Thanks!

    1) that's a strange question considering you prefaced it by saying you want to keep everything in flash.  so yes, given that requirement (ie, you want to put everything, if possible, in flash), put all your code inside flash.
    2) you need to scope everything. there's no problem (from flash/exportJS) spreading code over different frames/layers, if that's what you want to do.  you probably just need to be more careful with your scoping if think code in one layer won't recognize functions in another layer.  ie, in your top layer, use:
    var tl = this;
    // and then use tl to reference the main timeline in your functions (and elsewhere).

  • Setting image over the checkbox of JCheckBox

    hi everybody,
    I m new new to the forum so dont know about any rule but I am in trouble to setting image over the check box in JCheckBox(not side of the checkbox). I just want to cover the checkbox by some icon. I just wanna know is it possible? if ya how? it will be great help to me.
    thanks in advance for any kinda suggesion.

    Hi sudip;
    use JCheckBox(String text, Icon icon); to display icon instated of checkbox. and to differ checked & unchecked box use setSelectedIcon(Icon) on checkbox object to display some other icon whenever box is selected.

  • It's possible to set the number of frame?

    It is recommand to set the number of channels as low as possible, and it is easy to do. But it is recommended to decrease the number of frames? If yes, how can i do it? It seems to me that the manuals do not mention this aspect.
    Thanks.

    Yes but if it is so why it is recommended to set the numbers of channels as low as possible?
    It is sure that is not possible to to set the number of frame? I remember that long time ago  maybe I find something about how to set the frame's number, but
    it is possible that I'm wrong. 
    Thank you.

  • SELECTing records from two tables. Set Operators, CASE, DECODE, ...

    Hi all,
    I have two tables:
    CRETE TABLE T1 (T1_COL1 NUMBER, T1_COL2 NUMBER)
    CRETE TABLE T2 (T2_COL1 NUMBER, T2_COL2 NUMBER)
    T1 may or may not have records. T2 always has records. There are two scenarios.
    Scenario 1:
    =======
    SELECT * FROM T1 returns five rows, and SELECT * FROM T2 returns 10 rows.
    Now I need the five rows from T1.
    Scenario 2:
    =======
    SELECT * FROM T1 returns zero rows, and SELECT * FROM T2 returns 10 rows.
    Now I need the 10 rows from T2.
    In other words, if records present in T1, I need them all. If not, I need records from T2.
    There are no common columns (for joins).
    Now need a single query to achive this. I tried set operators, CASE and DECODE. But I'm unable to solve it.
    Please help. Thanks in advance.

    Iniyavan wrote:
    Yes, Justin. I'm sure that this is the way it's modelled. I also find it's tough and odd.Are you sure it's the right way for that data to be modeled? I understand that's the way it is being modeled, but a data model change may be the best option.
    Is there any other way, which is simpler, without using RANK?That's the simplest option I can think of. You could also do something like
    SELECT t1_col1, t1_col2
      FROM (
        SELECT t1_col1, t1_col2, rownum rn
          FROM (
            SELECT t1_col1, t1_col2
              FROM (
                SELECT t1_col1, t1_col2, 1 tbl
                  FROM t1
                UNION ALL
                SELECT t2_col2, t2_col2, 2 tbl
                  FROM t2       
             ORDER BY tbl
    WHERE rn = 1I'm not sure that's any simpler...
    Justin

  • Joins subqueries set operators

    Hi All,
    I am new to oracle SQL, Could any body tell me what is the differences between Joins, subqueries, set operators ? What is the benifits or advantages and dis-advantages comparing the above three.
    Thanks in advance
    Mahesh Ragineni

    Not using that syntax you won't in PL/SQL as it's just wrong.
    As you're querying multiple rows you'd have to either loop or collect it in to a collection e.g.
    SQL> declare
      2    type aNums is table of number;
      3    vNums aNums;
      4  Begin
      5    select n
      6      bulk collect into vNums
      7    from
      8      (
      9      select 1 as n from dual
    10      union
    11      select 2 from dual
    12      );
    13  end;
    14  /
    PL/SQL procedure successfully completed.
    But yes, you can use any SQL statements in SQL that you use in PL/SQL.

  • Setting Text over an Icon which is on a JLabel - Urgent

    Can someone help me. I need to set some text over an Image/Icon which is placed over a JLabel.

    You should simply change the iconTextGap value (according to the string width and the icon width if you want it centered) :
              JFrame frame = new JFrame("Centered label");
              JLabel label = new JLabel("centered label",new ImageIcon("im1.gif"),SwingConstants.LEFT);
              frame.getContentPane().add(label, BorderLayout.CENTER);
              frame.pack();
              frame.setVisible(true);
              int iconWidth = label.getIcon().getIconWidth();
              Font font = label.getFont();
              Graphics g = label.getGraphics();
              FontMetrics fm = g.getFontMetrics();
              int stringWidth = fm.stringWidth(label.getText());
              label.setIconTextGap(-stringWidth+((stringWidth-iconWidth)/2) );
    I have made the frame visible before setting the texticongap because you can't get the graphic context of a component if this component is invisible.
    Now the label is perfectly centered on the icon.
    I hope this helps,
    Denis

Maybe you are looking for

  • How to add new fields to CRM contract Product List tab?

    Hi all! I would like to add a new custom field for CRM contract (CRMD_BUS2000121) item level, on the Product List tab. Here I found CRMT_0100A_ORDPRP_I_EXT_UI structure, therefore I enhanced this with new append structure and new fields. I also added

  • How to restrict the material for speific storage type

    Dear all, i am maintained  the X - material to 001 warehouse and 001 rack storage type when i try to create TO for putaway process it will allow me some  other storage type like open,shelf....as per my client requirement it should not be ..... i am u

  • Archiving Sales Documents

    Hello Everyone, Does anyone know how you kan read archived SD Quotations in the original transaction VA23 (like with orders in VA03) Greetings, Peter

  • Converting .MTS for use in Final Cut Express, without loosing quality

    I have an external hard drive full of .MTS files from my JVC camcorder that I cannot open with Final Cut Express. I bought a piece of conversion software, iSkySoft Video Converter, to convert them into a more accessible format such as .mov or .avi, b

  • Problème d'affichage texte dans Adobe Encore avec menu photoshop importé  (cs6)

    Bonjour à toutes et tous Le texte provenant de photoshop pixelise dans adobe encore. Le but étant de survoler une image et la rendre plus clair (50%) pour afficher un texte noir dessus. Je réussi bien à faire la procédure mais le texte n'est pas net