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

> ### Name: IDLFM
> ### Title: Individualized Dynamic Latent Factor Model
> ### Aliases: IDLFM
> 
> ### ** Examples
> 
> library(splines)
> #if (!require("BiocManager", quietly = TRUE))
> #install.packages("BiocManager")
> #BiocManager::install("SparseArray")
> library(SparseArray)
Loading required package: Matrix
Loading required package: BiocGenerics

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
    as.data.frame, basename, cbind, colnames, dirname, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
    pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
    union, unique, unsplit, which.max, which.min

Loading required package: MatrixGenerics
Loading required package: matrixStats

Attaching package: ‘MatrixGenerics’

The following objects are masked from ‘package:matrixStats’:

    colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
    colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
    colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
    colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
    colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
    colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
    colWeightedMeans, colWeightedMedians, colWeightedSds,
    colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
    rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
    rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
    rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
    rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
    rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
    rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
    rowWeightedSds, rowWeightedVars

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:Matrix’:

    expand, unname

The following object is masked from ‘package:utils’:

    findMatches

The following objects are masked from ‘package:base’:

    I, expand.grid, unname

Loading required package: S4Arrays
Loading required package: abind
Loading required package: IRanges

Attaching package: ‘S4Arrays’

The following object is masked from ‘package:abind’:

    abind

The following object is masked from ‘package:base’:

    rowsum

> 
> I <- 3
> J <- 5
> time <- 1000
> R <- 3
> k <- 3
> N <- 300
> idx_x <- randomSparseArray(c(I, J, time), density=0.8)
> idx_y_train <- randomSparseArray(c(I, 1, time), density=0.2)
> idx_y_test <- randomSparseArray(c(I, 1, time), density=0.2)
> data <- generate_data(I, J, time, idx_x, idx_y_train, R, k, N)
Error: unable to find an inherited method for function ‘nzcount’ for signature ‘x = "numeric"’
Execution halted