Questions tagged [r-raster]

raster is an R package for geographic data analysis and modeling.

Other resources

Related tags

1217 questions
0
votes
3 answers

R automatically use data table name in output

I have a loop in which I want to create a character vector of output file names by combining elements in rasnames with "_unc.tif" rasnames = list("Wheat","Sbarley","Potato","OSR","fMaize") I tried for (i in 1:length(rasnames)){ filenm <-…
B.Wel
  • 86
  • 10
0
votes
0 answers

Memory problems with rasterbricks on cluster

#load a .nc file temp=brick(temp.nc) temp temp class : RasterBrick dimensions : 180, 360, 64800, 2928 (nrow, ncol, ncell, nlayers) resolution : 1, 1 (x, y) extent : 0, 360, -90, 90 (xmin, xmax, ymin, ymax) coord. ref. :…
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
0
votes
1 answer

why raster doesn't always print all information of a brickRaster? [r]

I am using the package raster to read ncdf files, everything works fine aside from the behavior that I get when I just type the brickRaster name. #load a .nc file temp=brick(temp.nc) temp class : RasterBrick dimensions : 180, 360, 64800,…
Herman Toothrot
  • 1,463
  • 3
  • 23
  • 53
0
votes
0 answers

Iterate raster in R

I want to ask about the Raster package. Is there a way to iterate through raster values, without transforming the values and doing a for from 1 to raster max value ? For example, in the raster bellow I need to do an operation on all "1" values,…
MarujoRe
  • 202
  • 1
  • 6
0
votes
1 answer

bilinear interpolation with extract(): show intermediate steps

I use extract() to get bilinear interpolated points out of my raster-object. Is there a way to show intermediate steps of the interpolation? I would be interested in the coordinates and values of the nearest four grid-points and the distances to my…
moremo
  • 315
  • 2
  • 11
0
votes
1 answer

Increment Loop in Batches

I was hoping someone could help me with a loop function I'm working with. I have tried searching Google and Stack Overflow extensively but, as I don't know the exact search terminology, I fear I am missing some results. With that in mind, I…
Simon
  • 991
  • 8
  • 30
0
votes
1 answer

Calculating mean values per grid-cell of data with associated coordinates

I have a raster file called gridmap, projected in UTM, of class: SpatialGridDataFrame which looks like this: Object of class SpatialGridDataFrame Coordinates: min max [1,] 415.0 545.5 [2,] 6371.5 6493.0 Is projected: TRUE proj4string…
Jojo
  • 4,951
  • 7
  • 23
  • 27
0
votes
2 answers

Looping code to export raster from stack

I am trying to code a loop that creates and exports rasters from a stack. The stack is composed of data for 20 individual animals that I processed from my original dataframe (e.g. animal$ID) Here is the code I have written so far.…
0
votes
1 answer

"IDs do not match" error when extracting raster values at SpatialLines

I want to extract a raster's values where a spatialLines object crosses its cells, and am hitting an error. This illustrates: > require(maptools); require(raster) > data(wrld_simpl) > nepal = as(wrld_simpl[wrld_simpl$NAME == 'Nepal',],…
geotheory
  • 22,624
  • 29
  • 119
  • 196
0
votes
1 answer

R - Rasterize a SpatialPolygonsDataFrame - variables/attributes dropped

Whenever I rasterize my SpatialPolygonsDataFrame, I lose the attribute / data information part. The command "rasterize" is from the package "raster" in R. I have the following RasterLayer (named "raster1") class : RasterLayer dimensions :…
user823
  • 265
  • 2
  • 14
0
votes
0 answers

R - Should I use rasters to plot this data onto a map?

I have a 5 column dataframe that I'm trying to make into something like a density plot. Each row in this dataframe represents a cell in a grid that maps onto a geographic area. Let's call the dataframe columns A, B, C, D, and E. Column A contains…
0
votes
0 answers

Recenter several stacked rasters in the Pacific ocean

I am currently working in R with environmental data at a regional scale in Australasia for modeling species distribution. I converted these environmental files into raster for the analyzes, using the raster package and stack them together. All of…
0
votes
1 answer

Change the zone interval in rasterVis horizonplot

I'm working with rasterVis horizonplot function and I want to change the zone interval; for example I want to show the average for every 10 latitudinal zones in the x axis. This is an example from rasterVis…
Geo-sp
  • 1,704
  • 3
  • 19
  • 42
0
votes
1 answer

Granger causal tests on raster stacks in R

I am attempting to do a pixel-wise granger causal test on two raster stacks with 60 rasters each. The example below has only 20 rasters: library(raster) library(lmtest) r <- raster(ncol=10, nrow=10) r[]=1:ncell(r) S <-…
Joke O.
  • 515
  • 6
  • 29
0
votes
1 answer

why doesn't this method of sorting raster objects work in R?

I'm working on a project that has large raster objects that are associated with variables and modified inside a function. I already sort the variables I need inside the function but I now want to return not just the sorted matrix of my variables but…