Learn R Programming

memuse (version 4.2-3)

howbig: howbig

Description

Determines the memory usage for a dense, in-core, numeric matrix of specified rows/columns.

Usage

howbig(
  nrow = 1,
  ncol = 1,
  representation = "dense",
  unit = "best",
  prefix = "IEC",
  names = "short",
  sparsity = 0.05,
  type = "double",
  intsize = 4
)

Value

returns a memuse class object.

Arguments

nrow, ncol

Number of (global) rows/columns of the matrix.

representation

The kind of storage the object would be in, i.e. "dense" or "sparse".

unit

string; the unit of storage, such as "MiB" or "MB", depending on prefix. Case is ignored.

prefix

string; the unit prefix, namely IEC or SI. Case is ignored.

names

string; control for whether the unit names should be printed out or their abbreviation should be used. Options are "long" and "short", respectively. Case is ignored.

sparsity

The proportion of sparsity of the matrix if representation="sparse"

type

"float", "double", or "int"; the storage type of the data matrix. If you don't know the type, it is probably stored as a double, so the default value will suffice.

intsize

The size (in bytes) of an integer. Default is 4, but this is platform dependent.

Details

These functions provide the memory usage of an unallocated, dense, in-core, numeric matrix. As the name suggests, howbig() simply returns the size (as a memuse object).

See Also

howmany

Examples

Run this code
if (FALSE) {
# size of a 1000x1000 matrix
howbig(1000, 1000)
}

Run the code above in your browser using DataLab