search for: raster

Displaying 20 results from an estimated 640 matches for "raster".

Did you mean: master
2009 Feb 21
1
Extracting xy from raster based on raster value
I have a raster (which I called glc), which I read into R as a raster with "raster.create.from.file" from the raster package (R-forge). Values in glc range between 1 and 27 (whole numbers only). I'd like to extract all cells with a value of 1 to create a new raster with only the cells that have a val...
2011 Jan 31
1
str() on raster objects fails for certain dimensions
Hi, str() on raster objects fails for certain dimensions. For example: > str(as.raster(0, nrow=1, ncol=100)) 'raster' chr [1, 1:100] "#000000" "#000000" "#000000" "#000000" ... > str(as.raster(0, nrow=1, ncol=101)) Error in `[.raster`(object, seq_len(max.len))...
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: libr...
2012 Jan 25
4
x11() graphic device, displaying raster
Hello, I am wondering about the X11() graphic device on Windows. I try to plot a raster image but nothing gets displayed. I found some pages where it is mentioned that x11() not always supports raster rendering. Is there any add on for x11, any update or any R-package which solves that displaying problem in Windows? What I try to test it is an example from the package {raster}: libr...
2012 Oct 29
3
How can I map numbers to colours with raster?
This code will read binary file and display it as a map. may problem is that this code is using a continuous colour scheme, even though I have discrete data (which is a classification scheme). How can I map numbers to colours with raster? Please require(raster) conne <- file("C:\\lai.bin", "rb") sd<- readBin(conne, integer(), size=1, n=360*720, signed=F) y<-t(matrix((data=sd), ncol=360, nrow=720)) r = raster(y) extent(r) = extent(c(xmn=-180,xmx=180,ymn=-90,ymx=90)) plot(r) -- View this message...
2018 Jun 01
1
rasterize SpatialPolygon object using a RasterBrick object
I am trying to rasterize a SpatialPolygon object by a RasterBrick object. The documentation of the raster::rasterize function explicitly says this is allowed. Here's what I am doing # load the raster package library("raster") # create a raster brick object using the example from the brick function documen...
2020 Oct 31
2
raster::levels() not working in packaged function.
Apologies, I cannot see how to make a rero for this issue. I have a function that uses levels(r) tor return the RAT of a raster "r" when the function is sourced from a script source(".\R\function.r") it works fine. when the function is built into a package and sourced from there library(mypackage) using the same script file to make the package levels(r)[[1]] the same line throws an error, as levels(myras...
2011 Jun 10
2
merge large number of raster objects
Hello, I have a large number of raster objects in memory, with names RH100, RH101, RH102, etc. (myobjects <- ls(pattern='^RH')). These rasters are sections of a continuous map, and I would like to combine them using the RasterObject merge tool in package 'raster.' Merge expects an input list of raster objects (outm...
2013 Apr 24
2
How to make a raster image in R from my own data set
Hi R-user, I was trying to make a raster map with WGS84 projection in R, but I could not make it. I found one data set in Google that data is almost the same format as of mine. I wanted to make a raster map of temperature with 1 degree spatial resolution for the global scale. I could make it in GIS software but I do have many variables (...
2011 Dec 01
1
Raster manipulation in R
...f R. Now I am intended to implement a flood algorithm using R. I have some MatLab experience doing these, and as an example to explain more or less what I want, I have a m code to calculate the slope from a Digital elevation model: slope=zeros(row,col); for i=2:row-1 for j=2:col-1 dzdx=(raster(i,j+1)-raster(i,j-1))/(2*res); dzdy=(raster(i+1,j)-raster(i-1,j))/(2*res); slope(i,j)=sqrt(dzdx^2+dzdy^2); end end; The question is to know how to do the similar procedure on R. All suggestions are welcome Thanks All best, Jorge PD:I am using R on windows system 64 bits -- Vi...
2013 Jan 29
2
Netcdf and Raster Package Questions, Need .asc File for GIS
Hello R-Group, I am new working with netcdf files and the raster package in R.I am trying to read in a netcdf file using the package "ncdf".I am able to get the lat, lon and parameter I need and can plot using fill.contour.Ultimately, I am trying to create a .asc file to reafd into GIS.I am using the package "raster" to read the parameter...
2013 Oct 24
1
Plot.raster hides the axis layer
Hi all, I am trying to plot a raster object (I can explain why but the point is that it would be a raster objeƧt).. I have selected a small code to show you exactly the problem require(raster) test<-matrix(data=runif(10000),nrow=100) m<-raster(test) plot(m,axes="FALSE") axis(1,at=c(0,1),labels=c("a","...
2012 May 10
2
converting raster image
Dear R users, I was wondering how I can convert a raster image (that made R through interpolation) into an ascii or csv format? this is the last line of my command p <- interpolate(r, tpsfit) So p is my raster file which I want to convert into ascii or csv Many thanks Regards Mintewab
2010 Jan 16
1
"Too many raster images" in devPS.c
Hi, I am finding the recently added [1] functionality of embedding raster images into plots on R devices very useful! Thanks to Paul Murrell and others for providing that. I noted that in https://svn.r-project.org/R/trunk/src/library/grDevices/src/devPS.c a macro is defined: #define MAX_RASTERS 64, and consequently, I get Error in grid.Call.graphics("L_raster&qu...
2012 Nov 27
5
Predict function in Raster package
Hey, I am having troubles using the 'predict' function with in the Raster package. I am using pm<-predict(mm, predictors) where mm is the mahalanobis distance and the predictors are a stack of 6 raster layers containing environmental variables. When I try to run the prediction I get the following warning message: Warning message: In layerNames(x): the layerNames f...
2012 Mar 21
2
To overlay my raster and its boundary
Hi I want to overlay my raster and its boundary which is a shapefile. When I used thise code separately, all is ok: # Open raster >Image<-read.table("C:\\Users\\Documents\\Nouveau\\Frequence.txt",sep="",dec=",",header=TRUE) >testo<-rasterFromXYZ(Image) >plot(testo) >test...
2017 Nov 15
1
Rasterize function with maximum in R
Hi all, I have some concerns regarding the rasterize option in R and I would like to know if the fun=max in rasterize in R provides similar results to the one achieved by using "Polygon to Raster using maximum-combined-area" in ArcGIS? I'm trying to rasterize a habitat layer to a raster of 10m spatial resolution using the function &...
2010 Jul 02
2
S4 classes and debugging - Is there a summary?
...to go to the source, which doesn't really help in easily finding the bit of code you're interested in. Getting the code with getAnywhere() doesn't always work. Debug() doesn't work. Using trace() and browser() is not an option, as I can't find the correct method. eg : library(raster) > getAnywhere(xyValues) A single object matching ?xyValues? was found It was found in the following places package:raster namespace:raster with value standardGeneric for "xyValues" defined from package "raster" function (object, xy, ...) standardGeneric("xyValues&...
2009 Dec 01
6
raster support in graphics devices
Hi This is for developers of extension packages that provide extra *graphics devices* for R. In the *development* version of R, support has been added to the graphics engine for sending raster images (bitmaps) to a graphics device. This consists mainly of two new device functions: dev_Raster() and dev_Cap(). The R_GE_version constant (in GraphicsEngine.h) has been bumped up to 6 as a marker of this change. This means that, at a minimum, all graphics devices should be updated to p...
2009 Apr 18
1
install raster package on ubuntu
Dear all, I am running R 2.8.1. under ubuntu, and I need to install the package "raster" but I get the following error: > install.packages("raster") Warning in install.packages("raster") : argument 'lib' is missing: using '/usr/local/lib/R/site-library' --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ....