here it is
df<-data.frame(
x = c(142440.41,142961.81,143267.33,
143236,143665.82,142813.32),
y = c(167843.83,168237.34,168085.43,
168213.28,169220.81,169094.54),
residualZn = c(0.488249621071484,
-0.172036591379516,0.117844597600621,
0.617521750723651,-0.286365623586011,
-0.0886741489196016)
)
library(gstat)
#> Warning: le package 'gstat' a été compilé avec la version R 3.6.3
library(sp)
#> Warning: le package 'sp' a été compilé avec la version R 3.6.3
head(df)
#> x y residualZn
#> 1 142440.4 167843.8 0.48824962
#> 2 142961.8 168237.3 -0.17203659
#> 3 143267.3 168085.4 0.11784460
#> 4 143236.0 168213.3 0.61752175
#> 5 143665.8 169220.8 -0.28636562
#> 6 142813.3 169094.5 -0.08867415
class(df)
#> [1] "data.frame"
coordinates(df)=~x+y
class(df)
#> [1] "SpatialPointsDataFrame"
#> attr(,"package")
#> [1] "sp"
vario_df<-variogram(df~1, data=df)
#> Error in model.frame.default(terms(formula), as(data, "data.frame"), na.action = na.fail): l'objet n'est pas une matrice
plot(vario_df)
#> Error in plot(vario_df): objet 'vario_df' introuvable
mdf<-data.matrix(df,rownames.force = NA)
#> Error in as.vector(data): pas de méthode pour convertir automatiquement cette classe S4 en vecteur
at least I learnt how to do a reprex thanks to you 