3

Currently I'm generating the MD5 checksum for a package using:

library(tools)
#the files in the package main directory and subdirectories
names = (list.files("package_directory/", recursive = T)) 
files = do.call(paste, list("package_directory", names, sep = "")) 
#pasting the directory name so it forms a complete filename, can be skipped 
##if you set your working directory to the same directory as the package

#md5 checksum generation
md5 = as.vector(md5sum(files))
#aggregating it in a file
expt = do.call(paste, list(md5, names, sep = " *"))
#and writing it to the package directory
write(expt, "package_directory/MD5")

I just started venturing package development, and I'm not sure this method will always work. So, what's the smart way of doing it all?

catastrophic-failure
  • 3,759
  • 1
  • 24
  • 43

0 Answers0