diff --git a/src/soil_compression_geospatial_inputs.R b/src/soil_compression_geospatial_inputs.R index ed09043..ab2c83b 100644 --- a/src/soil_compression_geospatial_inputs.R +++ b/src/soil_compression_geospatial_inputs.R @@ -86,11 +86,12 @@ for (i in 1:n_cells) { ex <- extent(cell) # Take a random sample of n points from the 50 km cell - rs <- SpatialPoints(data.frame( - x = sample(ex[1]:ex[2], n_samp, replace = T), - y = sample(ex[3]:ex[4], n_samp, replace = T) - ), - proj4string = crs(cell) + rs <- SpatialPoints( + data.frame( + x = sample(ex[1]:ex[2], n_samp, replace = T), + y = sample(ex[3]:ex[4], n_samp, replace = T) + ), + proj4string = crs(cell) ) # extract the cultivated layer to get fraction of cell cultivated