Coder Social home page Coder Social logo

Comments (8)

peekxc avatar peekxc commented on June 4, 2024

Seems kind of strange that kNNdistplot works but dbscan doesn't.

.ANNsplitRule is an un-exported array used internally by the package.

Did you load with library("dbscan")? Does it show up in the output of search() or getAnywhere(".ANNsplitRule")?

from dbscan.

princeBruce avatar princeBruce commented on June 4, 2024

I'm using RStudio on a MAC. I did load "dbscan", , and by running search() it shows "package:dbscan". In fact, OPTICS works. The two have similar ways of using .ANNsplitRule.

from dbscan.

peekxc avatar peekxc commented on June 4, 2024

Just to verify, optics works and dbscan does not?

library("dbscan")
data(iris)
iris <- as.matrix(iris[,1:4])
kNNdistplot(iris, k = 5)
abline(h=.5, col = "red", lty=2)
res <- dbscan(iris, eps = .5, minPts = 5)

For example, the above works on my mac.

from dbscan.

princeBruce avatar princeBruce commented on June 4, 2024

Correct.

library("dbscan")
data(iris)
iris <- as.matrix(iris[,1:4])
kNNdistplot(iris, k = 5)
abline(h=.5, col = "red", lty=2)
res <- dbscan(iris, eps = .5, minPts = 5)
Error in pmatch(toupper(splitRule), .ANNsplitRule) :
object '.ANNsplitRule' not found
library("dbscan")
data(iris)
iris <- as.matrix(iris[,1:4])
kNNdistplot(iris, k = 5)
abline(h=.5, col = "red", lty=2)
res <- optics(iris, eps = .5, minPts = 5)

This's what I got from running the same commands in the console. Could it be the version of the package? I just installed dbscan yesterday by running install.packages("dbscan"). Is there a different url I can go with?

from dbscan.

mhahsler avatar mhahsler commented on June 4, 2024

The issue seems to be the collate order (files are loaded in alphabetical order), and your version of R seems to evaluate the symbol right after reading the file. @princeBruce can you post the output of sessionInfo() after you load dbscan.

from dbscan.

princeBruce avatar princeBruce commented on June 4, 2024

Here is what I got. Thanks.

sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] testthat_1.0.2 factoextra_1.0.5 ggplot2_2.2.1 fpc_2.1-10 dbscan_1.1-1

loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 DEoptimR_1.0-8 compiler_3.4.0 plyr_1.8.4 ggpubr_0.1.5
[6] bindr_0.1 class_7.3-14 tools_3.4.0 prabclus_2.2-6 digest_0.6.12
[11] mclust_5.3 tibble_1.3.4 gtable_0.2.0 lattice_0.20-35 pkgconfig_2.0.1
[16] rlang_0.1.2 ggsci_2.8 ggrepel_0.7.0 mvtnorm_1.0-6 bindrcpp_0.2
[21] trimcluster_0.1-2 dplyr_0.7.4 cluster_2.0.6 stats4_3.4.0 diptest_0.75-7
[26] grid_3.4.0 nnet_7.3-12 robustbase_0.92-7 glue_1.1.1 R6_2.2.2
[31] flexmix_2.3-14 kernlab_0.9-25 purrr_0.2.4 magrittr_1.5 scales_0.5.0
[36] modeltools_0.2-21 MASS_7.3-47 assertthat_0.2.0 colorspace_1.3-2 labeling_0.3
[41] lazyeval_0.2.0 munsell_0.4.3 crayon_1.3.4

from dbscan.

mhahsler avatar mhahsler commented on June 4, 2024

I moved the definitions and that hopefully fixes your problem. Please try:

library("devtools")
install_github("mhahsler/dbscan")

and let us know if this fixes the problem.

from dbscan.

princeBruce avatar princeBruce commented on June 4, 2024

Have reinstalled the package, and now the function "dbscan" works.

Thanks a lot for the help and I will continue reading through the implementation.

from dbscan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.