I am at a complete loss on what I am doing wrong here.
I am trying to build a variogram. No matter what i do i get errors.
My Data:
id lon lat datetime m1 m2 m3
1 1 -121.3501 41.86009 2016-03-01 00:00:00-08:00 43.200 3993.071 3993.071
2 2 -121.3412 41.94472 2016-03-01 00:00:00-08:00 38.800 4036.954 4036.954
3 3 -121.5138 41.99801 2016-03-01 00:00:00-08:00 24.600 4023.301 4023.301
After converting to a Spatial DataFrame
class : SpatialPointsDataFrame
features : 3196
extent : -124.2696, -116.1304, 33.11097, 42.01195 (xmin, xmax, ymin, ymax)
coord. ref. : NA
variables : 5
names : id, datetime, m1, m2, m3
min values : 1, 2016-03-01 00:00:00-08:00, 0.000, 0.020, 0.0003920282
max values : 3196, 2016-03-01 00:00:00-08:00, 14360.500, -7470.500, -3.4202715765
This is just a small piece of the data. About 3000 rows in total
My dataframe setup
df <- read.table("input.csv", header=TRUE, sep=",")
df = na.omit(df)
coordinates(df) = ~lon+lat
Some samples of what I have tried and the error messages:
v = variogram(m3~1, data=df)
Error in variogram(m3 ~ 1, data = df) : unused argument (data = df)
v = variogram(df$m3~1, data=df, dX=0)
Error in variogram(df$m3 ~ 1, data = df, dX = 0) :
unused arguments (data = df, dX = 0)
Since it keeps telling me these parameters are unused...I tried this:
v = variogram(df$m3~1)
Error in variogram(df$m3 ~ 1) :
argument "X" is missing, with no default
All I am trying to do at this point is create a basic variogram on the m2 or m3 column of data. m3 column is the m2 column with a normal score transformation done on it. I just left the code out for that.
What am I doing wrong?
v = variogram(m3~1, locations = df
?