s-u / Rserve

Fast, flexible and powerful server providing access to R from many languages and systems
http://RForge.net/Rserve
Other
282 stars 65 forks source link

Data.Frame/row.names #166

Closed kimmolinna closed 3 years ago

kimmolinna commented 3 years ago

I'm building a client for a DyalogAPL and if I try to get data.frame(iris) as a whole package with CMD_eval I will get row.names as the following bytes

32 8 0 0 0 0 0 128 106 255 255 255

I assume that something is missing because I will get row.names correctly with commands rownames(iris) and attributes(iris).

s-u commented 3 years ago

If a data frame has no explicit row names, R uses a short representation c(NA_integer_, -nrow(d)) to save space. I'm not sure what you are printing, because you should get an integer vector with two values. If you want more details, can you include the full code that you're using?

kimmolinna commented 3 years ago

And I just noticed that if you give those by yourself and list is starting from 1, R uses a short representation c(NA_integer_, nrow(d)). I got integer values but I didn't know what is NA_integer_ and I was surprised that nrow(d) is negative.