Showing results for 
Search instead for 
Did you mean: 

Irregular Behaviour using EmbedR

New Contributor III
New Contributor III


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



New Contributor
New Contributor

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),]"


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: