How to cluster center mean of DBSCAN in R

0 votes

Using dbscan in package fpc I am able to get an output of:

dbscan Pts=322 MinPts=20 eps=0.005
        0   1
seed    0 233
border 87   2
total  87 235

but I need to find the cluster center (mean of cluster with most seeds). Can anyone show me how to proceed with this?

Jun 26, 2018 in Data Analytics by Sahiti
• 6,370 points
823 views

1 answer to this question.

0 votes

Just index back into the original data using the cluster ID of your choice. Then you can easily do whatever further processing you want to the subset. Here is an example:

library(fpc)

n = 100
set.seed(12345)
data = matrix(rnorm(n*3), nrow=n)
data.ds = dbscan(data, 0.5)
> data.ds
dbscan Pts=100 MinPts=5 eps=0.5
        0 1 2 3
seed    0 1 3 1
border 83 4 4 4
total  83 5 7 5
> colMeans(data[data.ds$cluster==0, ])
[1]  0.28521404 -0.02804152 -0.06836167
answered Jun 26, 2018 by DataKing99
• 8,250 points

Related Questions In Data Analytics

0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
4,554 views
0 votes
1 answer

How to create dummy variables based on a categorical variable of lists in R?

You can use mtabulate in the following way: library(qdapTools) cbind(data[1], ...READ MORE

answered Apr 13, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
2,623 views
+1 vote
1 answer

How to convert a list of dataframes in to a single dataframe using R?

You can use the plyr function: data <- ...READ MORE

answered Apr 14, 2018 in Data Analytics by Sahiti
• 6,370 points
7,037 views
0 votes
1 answer

How to limit output of a dataframe in R?

For randomly sampling a row/cell where a ...READ MORE

answered Apr 18, 2018 in Data Analytics by kappa3010
• 2,090 points
3,393 views
0 votes
1 answer

How to cluster a very large dataset in R?

You can initially use kmeans, to calculate ...READ MORE

answered Jun 19, 2018 in Data Analytics by Sahiti
• 6,370 points
3,032 views
0 votes
1 answer

How to find out cluster center mean of DBSCAN in R?

Just index back into the original data ...READ MORE

answered Jun 27, 2018 in Data Analytics by Sahiti
• 6,370 points
1,457 views
0 votes
2 answers

Clustering in R

Clustering is a type of unsupervised learning ...READ MORE

answered Jul 9, 2018 in Data Analytics by zombie
• 3,790 points
948 views
+1 vote
1 answer

How to find out which version of R is loaded

You can use sessionInfo() to accomplish that. > sessionInfo() R version ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,840 points
715 views
0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,250 points
3,824 views
0 votes
1 answer

How to forecast season and trend of data using STL and ARIMA in R?

You can use the forecast.stl function for the ...READ MORE

answered May 19, 2018 in Data Analytics by DataKing99
• 8,250 points
2,172 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP