Learn R Programming

memuse (version 4.2-3)

Constructor: memuse Constructor

Description

Constructor for objects of class memuse.

Usage

mu(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for ANY mu(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for `NULL` mu(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for numeric mu(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for object_size mu(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for missing mu(size, unit = "best", prefix = "IEC", names = "short")

memuse(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for ANY memuse(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for `NULL` memuse(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for missing memuse(size, unit = "best", prefix = "IEC", names = "short")

# S4 method for numeric memuse(size = size, unit = "best", prefix = "IEC", names = "short")

# S4 method for object_size memuse(size, unit = "best", prefix = "IEC", names = "short")

Value

Returns a memuse class object.

Arguments

size

numeric; indicates the unit-multiple number of bytes used by the object.

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.

Details

For numeric objects, if the length is 1, then its value is used as the number of bytes. Otherwise, the object's memory usage in R is taken for the size parameter.

See Also

memuse-class Accessors Converters

Examples

Run this code
if (FALSE) {
### The value passed as 'size' is the number of bytes
x <- memuse(100, unit="kb")
x

y <- memuse(100, unit="kb", prefix="SI")
y

### Use the memory usage of object 'size'
memuse(rnorm(1e4))
}

Run the code above in your browser using DataLab