A wrapper for utils::object.size() that prints in megabytes (Mb) by default.

object_size(x, units = "Mb")

Arguments

x

An R object.

units

The units to be used when printing the size.

Value

A character string with the object size followed by the unit.