Skip to content
Prev 308954 / 398503 Next

problem in finding sizes of objects using a for loop

Dear All,

I wanted to extract the sizes of all created objects. For E.g when I
created 2 objects(x and y), I got their sizes using the following
code:
[1] "x" "y"
80024 bytes
824 bytes

However, I was unable to get their sizes when I used a for loop in the
following way:
+   print(c(objects[i],object.size(objects[i])))
+
+ }
[1] "x"  "64"
[1] "y"  "64"


The result obtained by me is wrong in second case.

I understood that variables x and y are treated as characters. But to
rectify this problem.

Regards,
Purna