This is what it returns
Error in group_by(iris, Species, drop = FALSE) %>% group_modify(~head(.)) %>% :
could not find function "%>%"
> mydata<-mydata[complete.cases(mydata),]
> tableau <- data.frame(x=mydata[,1],y=mydata[,5]);plot(tableau)
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
2: In min(x) : no non-missing arguments to min; returning Inf
3: In max(x) : no non-missing arguments to max; returning -Inf
> mydi = dist(tableau[,],method= "euclidean")
Warning message:
In dist(tableau[, ], method = "euclidean") : NAs introduced by coercion
> myclust <- hclust(mydi, method="ward.D2")
>
>
> (fv <- fviz_dend(x=myclust,cex = 0.8, lwd = 0.8, k = 5,
+ k_colors = "jco",
+ rect = TRUE,
+ rect_border = "jco",
+ rect_fill = TRUE,
+ color_labels_by_k = TRUE,
+ xlab="objectifs",
+ main = "Cluster Dendrogram",) )
>
> tableau$labels <- fv$plot_env$data$labels$label
> tableau$col <- fv$plot_env$data$labels$col
>
>
> tableau<- mutate(tableau,
+ clust = dense_rank(col))
Error in mutate(tableau, clust = dense_rank(col)) :
could not find function "mutate"
>
> walk(unique(tableau$clust),
+ ~write_csv(x = filter(tableau,clust==.),
+ path = glue("clust{.}.csv")))
Error in walk(unique(tableau$clust), ~write_csv(x = filter(tableau, clust == :
could not find function "walk"