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

length.ff

Getting and setting length


Description

Gets and sets length of ff objects.

Usage

## S3 method for class 'ff'
length(x)
## S3 replacement method for class 'ff'
length(x) <- value

Arguments

x

object to query

value

new object length

Details

Changing the length of ff objects is only allowed if no vw is used. Changing the length of ff objects will remove any dim.ff and dimnames.ff attribute. Changing the length of ff objects will remove any na.count or is.sorted attribute and warn about this. New elements are usually zero, but it may depend on OS and filesystem what they really are. If you want standard R behaviour: filling with NA ,you need to do this yourself. As an exception to this rule, ff objects with names.ff will be filled with NA's automatically, and the length of the names will be adjusted (filled with position numbers where needed, which can easily consume a lot of RAM, therefore removing 'names' will help to faster increase length without RAM problems).

Value

Integer scalar

Note

Special care needs to be taken with regard ff objects that represent factors. For ff factors based on UNSIGNED vmodes, new values of zero are silently interpreted as the first factor level. For ff factors based on SIGNED vmodes, new values of zero result in illegal factor levels. See nrow<-.

Author(s)

Jens Oehlschlägel

See Also

Examples

x <- ff(1:12)
  maxlength(x)
  length(x)
  length(x) <- 10
  maxlength(x)
  length(x)
  length(x) <- 16
  maxlength(x)
  length(x)
  rm(x); 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.