Hi, I'm trying to use this code. However the problem is when I tried to create means and min. I got this error
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'x' in selecting a method for function 'mean': incorrect number of dimensions
df_list <- split(Pdat1, as.factor(Pdat1$ID_P))
names(df_list)
distlo<-list()
for (i in names(df_list)){
dist_df<-df_list[[i]]
coordinates(dist_df)<-c("x","y")
dm<-spDists(dist_df)
rownames(dm)<-dist_df$ID
colnames(dm)<-dist_df$ID
dm<-dm[,1]
distlo[[i]]<-dm
}
means<-lapply(distlo, function(x) mean(x[,2][2:nrow(x)]))
Some of the data is attached here
Can someone help me with that?
Thank you so much
[details="Summary"]
This text will be hidden
[/details]