I am doing the R CMD check for my package using devtools::check and I encountered the same ERROR(see bellow) discussed here. 
I tried to do what was suggested there: I added a tag of #'@export before the #'@example in my prep.R code, and I also added export(prep) in NAMESPACE. However I still get the same error.
Does anyone knows how can I solve this?
Any help will be greatly appreciated
Ayala
* checking R/sysdata.rda ... OK
* checking examples ... ERROR
Running examples in 'prepdat-Ex.R' failed
The error most likely occurred in:
> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: prep
> ### Title: Aggregate Long Format Data According to Grouping Variables and
> ###   Generate a Number of Measures for Each Cell in the Aggregated Data
> ###   for Further Analysis
> ### Aliases: prep
> 
> ### ** Examples
> 
> data(stroopdata)
> x1 <- prep(
+          dataset = stroopdata
+          , file_name = NULL
+          , id = "subject"