Running examples in ‘CGManalyzer-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: CGManalyzer-package
> ### Title: Continuous Glucose Monitoring Data Analyzer
> ### Aliases: CGManalyzer-package CGManalyzer
> ### Keywords: package
> 
> ### ** Examples
> 
> ###################################################################################
> # The following are the example in the help file for CGManalyzer, which is also
> # the main file for using the Package
> ###################################################################################
> 
> # install from local source pacage
> # install.packages(paste0(getwd(), "/CGManalyzer_1.2.tar.gz"), repos = NULL)
> # or install from CRAN
> # install.packages("CGManalyzer")
> 
> library(CGManalyzer)
> 
> rm(list = ls())
> package.name <- "CGManalyzer"
> options(scipen = 999)
> mainFolder <- getwd()
> 
> ###################################################################################
> # use example data or your own data
> ###################################################################################
> useExampleData <- TRUE
> 
> if (useExampleData) {
+   SPEC.name <- "SPECexample.R"
+ } else{
+   ###################################################################################
+   # TODOs before creating file "00filelist.csv":
+   # Create a folder named "data" in working directory
+   # and copy files into it manually.
+   ###################################################################################
+ 
+ 
+   ###################################################################################
+   # Create a file named "00filelist.csv" in "data" folder with two columns,
+   # one for file name and one for group type.
+   ###################################################################################
+   dataFolder <-  file.path(mainFolder, "data")
+   listFile <- file.path(dataFolder, "00filelist.csv")
+   # create a empty file
+   if(!file.exists(listFile)){
+     file.create(listFile)
+     # list all files and their types
+     dataFiles <- list.files(dataFolder)
+     if(length(dataFiles)>1){
+       dataType <- rep("H",length(dataFiles))
+       fileFrame <- data.frame(dataFiles, dataType)
+       # save to 00filelist.csv file
+       write.csv(fileFrame,listFile,row.names = FALSE,quote = F)
+     }else{
+       stop("No data files found in the \"data\" folder!")
+     }
+   }
+ 
+   ###################################################################################
+   # TODOS after creating file "00filelist.csv":
+   # Specify the group type for each subject by changing the second
+   # column of 00filelist.csv manually. The default type is "H",
+   # which needs to be changed to the actual type manually.
+   ###################################################################################
+ 
+   ###################################################################################
+   # specify parameters for different CGM devices
+   ###################################################################################
+   # Choose one of the SPEC file that fits the CGM device that you are using for your study
+   # to use the example data in the package "CGManalyzer", you have to choose "SPECexample.R"
+   # if you want to run your own data, you cannot choose "SPECexample.R", instead, you need to choose
+   # one of "SPEC.FreestyleLibre.R", "SPEC.Glutalor.R" and "SPEC.Medtronic.R".
+   # You may also write your own file following the format in one of them.
+ 
+   SPEC.name <- "SPEC.FreestyleLibre.R"
+   # SPEC.name <- "SPEC.Glutalor.R"
+   # SPEC.name <- "SPEC.Medtronic.R"
+ }
> 
> setSPEC.fn(SPEC.name)
Warning in fac2char.fn(dataFileType.df[, 1]) :
  NAs introduced by coercion
Warning in fac2char.fn(dataFileType.df[, 2]) :
  NAs introduced by coercion
> 
> ###################################################################################
> ## get summary statistics: number of subjects, minimum, 1st quartile, median, mean,
> ##             mean, 2nd quartile, maximum, number of NA's, standard deviation, MAD
> ###################################################################################
> if (Summary) {
+   summary.arr <-
+     summaryCGM.fn(
+       dataFolder,
+       dataFiles,
+       responseName,
+       sensorIDs,
+       columnNames,
+       skip = Skip,
+       header = Header,
+       comment.char = Comment.char,
+       sep = Sep
+     )
+   # write.csv(file = "summaryStatistics.sensor.csv",
+   #           summary.arr[, , 1])
+   print(summary.arr[,,1])
+ }
[1] "1 th file"
Warning in file(file, "rt") :
  'raw = FALSE' but '/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/CGManalyzer/exampleDATA/' is not a regular file
Warning in file(file, "rt") :
  cannot open file '/home/hornik/tmp/R.check/r-devel-gcc/Work/build/Packages/CGManalyzer/exampleDATA/': it is a directory
Error in file(file, "rt") : cannot open the connection
Calls: summaryCGM.fn -> read.table -> file
Execution halted