Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

r

built-in

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")
like image 572
Ganesh Birajdar Avatar asked Aug 17 '15 04:08

Ganesh Birajdar


1 Answers

?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
like image 161
nathanesau Avatar answered Nov 02 '22 15:11

nathanesau