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: error in function that uses raster package

I have raster images and I want to apply a function that will give a value based of adjacent cells values. In a 3x3 window centered in that cell I want to give a cell a value between 0 and 8/8(=1) depending on how many cells (from the other 8 cells…
0
votes
1 answer

What is the best way to plot more than one raster with large between-raster variation in R?

I have been trying to develop a better solution to visualize my data using R. However, my efforts have not been fruitful so far. Assume you have 6 rasters ( the data is for a single variable measured at different times) where within-raster variation…
code123
  • 2,082
  • 4
  • 30
  • 53
0
votes
1 answer

How to change matlab list into raster brick in R

I have this mat file I get from someone, and I wanted to change it to raster brick in R. Importing was ok, I was able to import using the R.matlab package library(raster) library(rgdal)`enter code…
WAW
  • 143
  • 1
  • 10
0
votes
1 answer

Assigning Values within a dynamically named matrix in R

I am struggling with a loop in R where I have to use dynamic variable names (which I am told is a bad idea from the other posts about dynamic variable names, but I am pretty sure that I need to based on my file structure). Each folder for which the…
JFayne
  • 1
  • 3
0
votes
0 answers

R how to view standard generic method when no object is specified

I'm trying to view the writeRaster function in the raster package: > library("raster") > writeRaster standardGeneric for "writeRaster" defined from package "raster" function (x, filename, ...) standardGeneric("writeRaster") And showMethods…
cmbarbu
  • 4,354
  • 25
  • 45
0
votes
1 answer

Using grid2poly with raster

I am trying to take data from a raster and push it to KML format so that I get a series of gridded polygons. Looking at samples on the web it would appear that the way to go is to using grid2poly with plotKML. Unfortunately I have hit an error…
SteveG
  • 99
  • 1
  • 11
0
votes
1 answer

Why does R scale{raster} function give a different output than scaling the same raster in PythonWin?

I've used both R and PythonWin to spatially apply a statistical model. I created the same prediction raster in both programs and the outputs are different (not crazy different but different). I'm wondering if the difference between the two…
Kevin
  • 229
  • 3
  • 9
0
votes
1 answer

R: two functions with the same name and :: doesn't to work

I am trying to use the as.raster function of the raster package, but there is already a function with the same name in the grDevices package. So, I use the :: operator to differentiate between the two, but it doesn't appear to work. Can someone…
Dan
  • 11,370
  • 4
  • 43
  • 68
0
votes
2 answers

Use a formula stored in an object for the raster function overlay

I have been struggling with an issue for several hours and I am currently having a very hard trying to find a workaround. I want to use the overlay function of the raster package. This function combines multiple rasters (or raster layers of a stack)…
Boris Leroy
  • 460
  • 4
  • 14
0
votes
1 answer

Calculating area of occupancy from a binary unprojected raster

I have a series of binary raster layers (ascii file) showing presence/absence of a species in Europe and Africa. The file is based on unprojected lat/long (WGS84) data. My aim is to calculate the area of presence using R (I don't have access to…
Heather
  • 45
  • 1
  • 5
0
votes
2 answers

Calculating percentile across netcdf files fails

I have five netcdf files where each file contains data for a time section. I want to calculate the 98th percentile for the whole timespan for each cell individually. The accumulated file size for the netcdf files is around 250 MB. My approach it…
telegott
  • 196
  • 1
  • 10
0
votes
1 answer

How to write raster files to ENVI format as BIP

I want to stack and write some Landsat bands/tiff files to BIP interleave in ENVI format. However, the results always come as BSQ, even though I change the bandorder to BIP. Below is my…
Ktelo
  • 5
  • 3
0
votes
1 answer

Problems with general mean and subsets in rts in R

I have had a had time working with rts in R. I have a set of rasters and I need to find the mean over a period of time. This is what I have done so far: fun1G<-function(x){ attr1<-"HDFEOS/GRIDS/ColumnAmountNO2/Data Fields/ColumnAmountNO2Trop" …
Joke O.
  • 515
  • 6
  • 29
0
votes
1 answer

R raster package: memory shortage when using “getValuesFocal” function

I have raster (1300 by 1400 cells) with 3 layers and I would like to make focal calculations using data from all 3 layers. For example one of the layers is land cover map and I would like to use in calculations only these pixels in the focal window…
Rupal
  • 1
  • 2
0
votes
2 answers

Newest raster package won't plot a raster object in Windows

I'm trying to plot a raster using the "raster" package but I'm running against an error Here's my code map = raster("A055E.tif") plot(map) Error in `colnames<-`(`*tmp*`, value = "A055E") : length of 'dimnames' [2] not equal to array…
dvdkamp
  • 156
  • 5