install.packages("gstat") library(gstat) install.packages("sf") library(sf) install.packages("sp") library(sp) install.packages("geoR") library(geoR) install.packages("devtools") library(devtools) #library('mapping') TheData=read.csv("C:/Users/hp/Desktop/myfile.csv") plot(TheData$Var5,TheData$Var4) #load the sp library library(sp) #remove any null data rows TheData=na.omit(TheData) #convert simple data frame into a spatial data frame object coordinates(TheData)= ~ Var4+Var5 #create a bubble plot with the random values ##bubble(TheData, zcol='m_rand', fill=TRUE, do.sqrt=FALSE, maxsize=3) #TheVariogram=variogram(m_rand~1, data=TheData) #plot(TheVariogram) ###fit_var = gstat::fit.variogram(object = , model = ) ###TheVariogramModel <- vgm(psill=0.15, model="Gau", nugget=0.0001, range=5) f_spdf= sp::SpatialPointsDataFrame(coords = cbind(TheData$Var5,TheData$Var4), data=TheData, proj4string = sp::CRS(projargs = "+ init=epsg:32631")) vario = gstat::variogram(object = TheData ~ 1, locations = f_spdf)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)