# NOT RUN {
#simulate bias grid, one degree resolution, 10% error on a 1000 records dataset
##simulate biased fraction of the data, grid resolution = 1 degree
#simulate non-biased fraction of the data
bi <- sample(3 + 0:5, size = 100, replace = TRUE)
mu <- runif(3, 0, 15)
sig <- runif(3, 0.1, 5)
cl <- rnorm(n = 900, mean = mu, sd = sig)
lon <- c(cl, bi)
bi <- sample(9:13, size = 100, replace = TRUE)
mu <- runif(3, 0, 15)
sig <- runif(3, 0.1, 5)
cl <- rnorm(n = 900, mean = mu, sd = sig)
lat <- c(cl, bi)
#add biased data
inp <- data.frame(decimallongitude = lon,
decimallatitude = lat,
dataset = "test")
#plot overview
suma <- inp
suma[,1:2] <- round(suma[,1:2], 0)
suma <- aggregate(dataset ~ decimallongitude + decimallatitude, FUN = "length", data = suma)
colo <- rev(heat.colors(max(suma$dataset)))
plot(suma$decimallatitude ~ suma$decimallongitude, col = colo[suma$dataset])
#run test
dc_round(inp, value = "dataset")
# }
Run the code above in your browser using DataLab