Ganesh Birajdar
Ganesh Birajdar

Reputation: 115

Why 'object.size' not accepting 'units' argument

Apparently 'object.size' function accepting only one argument(i.e., object), but not 'units' or any other arguments. How can I tackle it?

here is what happens if I try it anyway:

object.size(averageBySubAct, units = "Mb")

Error in object.size(averageBySubAct, units = "Mb") : 
  unused argument (units = "Mb")

Upvotes: 7

Views: 2004

Answers (1)

nathanesau
nathanesau

Reputation: 1721

?object.size

this gives

object.size(x)

## S3 method for class 'object_size'
format(x, units = "b", ...)
## S3 method for class 'object_size'
print(x, quote = FALSE, units = "b", ...)

notice that object.size()takes one argument, x. However, we can print the result of object.size(x) and then use the units argument (as mentioned in the comments)

print(object.size(c(5,6,1)), units="Mb")
# 0 Mb

Upvotes: 6

Related Questions