Hi All,

I ran the following lines in R:

print(object.size(a <- rep(1,10^6)),units="Mb")
print(object.size(a <- rep(3.542,10^6)),units="Mb")

print(object.size(b <- rep("x",10^6)),units="Mb")
print(object.size(b <- rep("xyzxyz xyz",10^6)),units="Mb")
print(object.size(b <- 1:10^6),units="Mb")
print(object.size(b <- rep(1:10,each=10^5)),units="Mb")
print(object.size(b <- rep(TRUE,10^6)),units="Mb")

The object size from first two lines is 7.6 MB, but from the last five it is
3.8 MB, although the length of vector is same.

Apparently, the size of any vector of a given length is twice if the vector
is numeric constant than if it is not.

Why is it so? Is my observation wrong? Or, is there some catch with
'object.size'?

Thanks in advance.
Regards
Utkarsh

	[[alternative HTML version deleted]]

