integer(length=0) is.integer(x) as.integer(x)
is.integer returns TRUE if x is an object of storage mode "integer", and FALSE otherwise.
as.integer returns x if x is a simple object of storage mode "integer". Otherwise, it returns an integer object of the same length as x and with data resulting from coercing the elements of x to storage mode "integer". The numbers are truncated (moved to the closest integer the original number that is towards zero). Attributes are deleted.
Note the difference between coercing to a simple object of storage mode "integer" and setting the storage mode attribute: storage.mode(myobject) <- "integer" This changes the storage mode of myobject but leaves all other attributes unchanged (so a matrix stays a matrix). The value of as.integer(myobject) has no attributes.
z <- integer(length(zz)) # integer object same length as zz amp;.Fortran("mysub",as.integer(xm))