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 <-…
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,…
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,…
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…
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…
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…
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.…
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',],…
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 :…
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…
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…
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…
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 <-…
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…