## convert the example mod into raw data
data("mod.intro")
mod.raw <- as.raw(mod.intro)
## restore it as a PTModule-class object
mod.restored <- rawToPTModule(mod.raw)
## In this case the result is identical to the original:
identical(mod.restored, mod.intro)
Run the code above in your browser using DataLab