Hot answers tagged

4

The number of points above the 0.75 quantile is by definition always going be approximately 0.25. The variation you are getting is because if there's only a small number of points then the quantile computation is approximate or there's tied values. Compare: > metrics(runif(1000)) [1] 0.25 > metrics(runif(12)) [1] 0.25 > metrics(runif(13)) [1] 0....


2

Make a reproducible example: > set.seed(999) > xy = data.frame(x=runif(24), y=runif(24)) > xy$ID = rep(c(1:6), rep(4,6)) > head(xy) x y ID 1 0.38907138 0.8260703 1 2 0.58306072 0.8195141 1 3 0.09466569 0.5684927 1 4 0.85263123 0.6196068 1 5 0.78674676 0.8308805 2 6 0.11934226 0.4588336 2 Make the data frame into an sf ...


2

I resolve with this script: library(sp) library(rgdal) library(geosphere) # example data from the thread x <- c(-1.482156, -1.482318, -1.482129, -1.482880, -1.485735, -1.485770, -1.485913, -1.484275, -1.485866) y <- c(54.90083, 54.90078, 54.90077, 54.90011, 54.89936, 54.89935, 54.89935, 54.89879, 54.89902) # convert data to a SpatialPointsDataFrame ...


2

It was difficult to understand exactly what you were asking, but I think this solution using ggplot2 to view the rasters will better suit your needs. I could only test using my own sample data, but hopefully this will translate to your data as well. #dependencies library(lidR) library(ggplot2) library(stats) #specify file path infile <- '...


2

So close, use: files = list.files("path_to_data",pattern="*.tif$", full.names=TRUE) rs <- brick(files) or rs <- stack(files) Don't use map as name, there're several R functions with the same name. Then, to create a sum of all your rasters use calc function (from raster package): rs1 <- calc(rs, sum)


1

You can read the raster in R with the rasterpackage. It can be loaded with map <- brick("file_path"). Then you can apply addition operation between your loaded objects. If you have 365 of them, you should read them through a loop.


1

Note where the error is coming from and step through your code. Its not even getting to the Savitsky-Golay line. > v = as.vector(r) > z = na.spline(v) > s1.ts2 = ts(z, start=1, end=nlayers(z), frequency=12) Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘nlayers’ for signature ‘"numeric"’ The error ...


Only top voted, non community-wiki answers of a minimum length are eligible