## get the PTModule object provided with the ProTrackR package
data("mod.intro")
f <- tempfile(fileext = ".mod")
## save the object as a valid ProTracker module file:
write.module(mod.intro, f)
## or create the connection yourself:
con <- file(f, "wb")
write.module(mod.intro, con)
## don't forget to close the connection after you're done:
close(con)
Run the code above in your browser using DataLab