gdkrmr / dimRed

A Framework for Dimensionality Reduction in R
https://www.guido-kraemer.com/software/dimred/
GNU General Public License v3.0
73 stars 15 forks source link

DiffusionMaps fails for ndim=1 #37

Closed khughitt closed 5 years ago

khughitt commented 5 years ago

The DiffusionMaps method appears not to work when ndim is set to 1.

To reproduce:

library(dimRed)
set.seed(1)

embed(matrix(rnorm(1E5), 100), 'DiffusionMaps', ndim=1)
## Performing eigendecomposition
## Computing Diffusion Coordinates
## Elapsed time: 0.009 seconds

## Warning in seq_len(ncol(outdata)): first element used of 'length.out'
## argument

## Error in seq_len(ncol(outdata)): argument must be coercible to non-negative integer

System info

sessionInfo()
## R version 3.5.2 (2018-12-20)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Arch Linux
## 
## Matrix products: default
## BLAS: /usr/lib/libblas.so.3.8.0
## LAPACK: /usr/lib/liblapack.so.3.8.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] dimRed_0.2.2   DRR_0.0.3      CVST_0.2-2     Matrix_1.2-15 
## [5] kernlab_0.9-27 nvimcom_0.9-75 colorout_1.2-0
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.0           lattice_0.20-38      digest_0.6.18       
##  [4] grid_3.5.2           magrittr_1.5         evaluate_0.12       
##  [7] stringi_1.2.4        scatterplot3d_0.3-41 rmarkdown_1.11      
## [10] tools_3.5.2          stringr_1.3.1        igraph_1.2.2        
## [13] xfun_0.4             yaml_2.2.0           compiler_3.5.2      
## [16] pkgconfig_2.0.2      BiocManager_1.30.4   htmltools_0.3.6     
## [19] diffusionMap_1.1-0.1 knitr_1.21