I am trying to do some spatial analysis with a csv file that has been exported by ArcGIS and contains X and Y coordinates. However when I try this
pottery <- read.csv (file="pots.csv", header=TRUE)
coordinates(pottery) <- ~XCoord+YCoord
I get this error: Error in .local(obj, ...) : cannot derive coordinates from non-numeric matrix
My csv dataframe is in this form:
XCoord, YCoord, pottery.POINT_X, pottery.POINT_Y, Object(...)
1277.10140000,-915.96560000,1277.101400, -915.965600, P73(...)
str(pottery)
'data.frame': 601 obs. of 14 variables:
$ XCoord : chr "1277.10140000" "1281.93990000" "1309.94460000" "1301.58720000" ...
$ YCoord : chr "-915.96560000" "-930.18790000" "-939.57170000" "-931.36080000" ...
$ pottery.POINT_X: chr "1277.101400" "1281.939900" "1309.944600" "1301.587200" ...
$ pottery.POINT_Y: chr "-915.965600" "-930.187900" "-939.571700" "-931.360800" ...
$ Object : chr "P73" "P474" "P587" "P629" ...
$ Shape : chr "Amphora" "Jug" "Pithoid" "Pithos" ...
$ Use : chr "Storing" "Pouring" "Storing" "Storing" ...
$ Height : chr "86.8" "15" "NULL" "68.5" ...
$ Fabric : chr "M" "S" "M" "S" ...
$ Decoration : chr "Yes" "Yes" "Yes" "Yes" ...
$ Pattern : chr "Running Drops" "NULL" "Bands" "Running Drops" ...
$ Style : chr "Dark on light" "Painted" "Dark on light" "Dark on light" ...
$ Floor : chr "No" "No" "No" "No" ...
$ Fill : chr "No" "No" "No" "No" ...