Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jan 4th, 2013  |  syntax: None  |  size: 0.52 KB  |  hits: 17  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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"))