I am a R-Beginner, but I want to use it for some spatial statistics. I want to check the relation between the occurrence of ill persons and the existence of water in a area of interest. To give you a more specific use case, I've created some example datasets:
Firstly I want to plot them in a map including a basemap. This already works!
persons_dataframe = read.csv("persons.csv", header = TRUE) city_dataframe = read.csv("city.csv", header = TRUE) water_dataframe = read.csv("water.csv", header = TRUE) # plot them on a map # load used packages library(RgoogleMaps) library(ggplot2) library(ggmap) library(sp) persons_ggplot2 <- persons_dataframe city_ggplot2 <- city_dataframe water_ggplot2 <- water_dataframe gc <- geocode('new york, usa') center <- as.numeric(gc) G <- ggmap(get_googlemap(center = center, color = 'bw', scale = 1, zoom = 10, maptype = "terrain", frame=T), extent="device") G1 <- G + geom_point(aes(x=POINT_X, y=POINT_Y ),data=city_dataframe, shape = 22, color="black", fill = "yellow", size = 4) + geom_point(aes(x=POINT_X, y=POINT_Y ),data=persons_dataframe, shape = 8, color="red", size=2.5) + geom_point(aes(x=POINT_X, y=POINT_Y ),data=water_ggplot2, color="blue", size=1) plot(G1)
This has the following output:
No I want to create something like a cluster map. I've already looked for some useful packages and I've ended with the packages SpatialEpi and DCluser. Both provide some functions, which might be useful.
But at this point I don't know, how to proceed. Some open questions:
- Is it right that I need polygons to cluster the dataset? I've read it in the SpatialEpi pdf but I only have these point datasets.
- Additionally I don't know, if the fact that all points are located on only three locations might be a problem?!
Do you have a suggestions how to continue with my work?