Skip to content
Prev 47953 / 63424 Next

C API to get numrow of data frame

I didn't look at the names because I believe that would be incorrect
if the row names were stored internally in the compact form.

See ?.set_row_names (hat tip, Tim Hesterberg who showed me this years ago) :

     'row.names' can be stored internally in compact form.
     '.set_row_names(n)' generates that form for automatic row names of
     length 'n', to be assigned to 'attr(<a data frame>, "row.names")'.
     '.row_names_info' gives information on the internal form of the
     row names for a data frame: for details of what information see
     the argument 'type'.

The function I wrote obviously doesn't work for 0 row or 0 column
data.frames, you need to check for that.
On Mon, Mar 31, 2014 at 6:12 PM, G?bor Cs?rdi <csardi.gabor at gmail.com> wrote: