Closed Leprechault closed 9 months ago
d <- read.csv("https://raw.githubusercontent.com/Leprechault/trash/main/my_ts_data.csv")
l <- split(d$B2_MAX,d$STAND)
o <- tsclust(l,
type="partitional",
k=2L,
distance="dtw_basic",
centroid = "pam")
#plot
plot(o)
o
#partitional clustering with 2 clusters
#Using dtw_basic distance
#Using pam centroids
#Time required for analysis:
# usuário sistema decorrido
# 1.13 0.00 0.16
#Cluster sizes with average intra-cluster distance:
# size av_dist
# 1 14 3.518299e+198
# 2 50 4.526561e+08
I'd like to use time series clustering using the
dtwclust
package. The problem is the conversion of my data.frame to list of time series. All my blocks ID (namedSTAND
) has 180 days in negative values (DATE_TIME
) TheB2_MAX
is my variable response. In my example:Please, any help with it?