cancel
Showing results for 
Search instead for 
Did you mean: 

Irregular Behaviour using EmbedR

leades
Moderator Moderator
Moderator

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. 

leades_2-1653490123492.png

What could the possible cause of this error be?

Many Thanks

Luke

1 REPLY 1

emclaughlin1
Moderator Moderator
Moderator

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:
 
emclaughlin1_1-1654260835160.pngemclaughlin1_2-1654260873819.png

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

emclaughlin1_3-1654260918537.png