KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums KX Solutions Irregular Behaviour using EmbedR

  • Irregular Behaviour using EmbedR

    Posted by leades on May 25, 2022 at 12:00 am

    Hello,

    A client has put together some scripts that take tables from q, perform analysis in an R session and return separate tables back to q. They have seen some strange behaviour when trying to return one of the tables.

    The script works fine when the final line of code is commented out. This final line takes the first 4 rows from the table where the column datatype matches a certain value. If they run the part of that line which determines the indices of these rows, a which query, the positions are returned as expected. In this case, 1 2 3 4 is returned.

    However, when trying to retrieve these rows, a ‘domain: Argument to function out of function’s domain’ error is given. More interestingly, when hardcoding the indices in any order except 1 2 3 4, the data is outputted fine.

     

    What could the possible cause of this error be?

    Many Thanks

    Luke

    leades replied 8 months, 1 week ago 2 Members · 1 Reply
  • 1 Reply
  • emclaughlin1

    Member
    June 3, 2022 at 12:00 am

    Further detail:

    Question : Could you please confirm if you extract the first row and run meta on the extracted table in KDB, then do the same for each of the other 4 rows, do those metas match. Similar to below
    (meta[Rget”persDat[c(1),]”]) ~ meta Rget”persDat[c(2),]”

    Answer:

    I’ve tried to check the output when pulling out persDat row by row, as you suggest, but I get met with an error if I try and get a single row:

     

    Just to confirm, if I try and pull out the whole table at this point, then I do indeed get the full table back:

     

     

     

Log in to reply.