Skip to main content

extract_nrow

Function extract_nrow 

Source
fn extract_nrow(sexp: SEXP) -> Result<usize, DataFrameError>
Expand description

Extract nrow from R’s row.names attribute.

R data frames store row.names in two forms:

  1. Compact integer form: c(NA_integer_, -n) — meaning 1:n row names
  2. Explicit form: A character or integer vector of length n

If no row.names attribute exists, we fall back to the length of the first column.