Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nrowAssign

Assigning the number of rows or columns


Description

Function nrow<- assigns dim with a new number of rows.
Function ncol<- assigns dim with a new number of columns.

Usage

nrow(x) <- value
ncol(x) <- value

Arguments

x

a object that has dim AND can be assigned ONE new dimension

value

the new size of the assigned dimension

Details

Currently only asssigning new rows to ffdf is supported. The new ffdf rows are not initialized (usually become zero). NOTE that

Value

The object with a modified dimension

Author(s)

Jens Oehlschlägel

See Also

Examples

a <- as.ff(1:26)
  b <- as.ff(factor(letters)) # vmode="integer"
  c <- as.ff(factor(letters), vmode="ubyte")
  df <- ffdf(a,b,c)
  nrow(df) <- 2*26
  df
  message("NOTE that the new rows have silently the first level 'a' for UNSIGNED vmodes")
  message("NOTE that the new rows have an illegal factor level <0> for SIGNED vmodes")
  message("It is your responsibility to put meaningful content here")
  message("As an example we replace the illegal zeros by NA")
  df$b[27:52] <- NA
  df

  rm(a,b,c,df); gc()

ff

Memory-Efficient Storage of Large Data on Disk and Fast Access Functions

v4.0.4
GPL-2 | GPL-3 | file LICENSE
Authors
Daniel Adler [aut], Christian Gläser [aut], Oleg Nenadic [aut], Jens Oehlschlägel [aut, cre], Martijn Schuemie [aut], Walter Zucchini [aut]
Initial release
2020-10-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.