SHARE
TWEET

Untitled

a guest Jan 4th, 2013 18 Never
  1. ## Create 2 two-million length vectors, one character and one factor
  2. animalsChar <- c(rep("giraffe", 1e6), rep("pygmy chimpanzee", 1e6))
  3. animalsFac  <- factor(animalsChar)
  4.  
  5. ## Save them to two ".Rdata" files
  6. charFile <- "char.Rdata"
  7. facFile <-  "fac.Rdata"
  8. save(animalsChar, file = "char.Rdata")
  9. save(animalsFac, file = "fac.Rdata")
  10.  
  11. ## Compare the sizes of the two files
  12. file.info("char.Rdata", "fac.Rdata")["size"]
  13. #             size
  14. # char.Rdata 87390
  15. # fac.Rdata   7921
  16.  
  17.  
  18. ## Clean up
  19. unlink(c("char.Rdata", "fac.Rdata"))
RAW Paste Data
Top