All Questions
20 questions
1
vote
1
answer
173
views
gplot throws unable to find an inherited method for function ‘gplot’ for signature ‘"missing"’ with RasterBrick
I followed this answer to create raster files for each attribute in a shapefile and got a RasterBrick at the end. But when I try to plot it using gplot or ggplot2, it throws an error. I tried reading ...
0
votes
0
answers
92
views
face='bold' of axis.text do not work and axis.line only control left and bottom in ggplot
library(terra)
library(raster)
library(rasterVis)
f <- system.file("external/test.grd", package="raster")
r <- rast(f)
r
rr <- project(x=r,y='epsg:4326')
rr
gplot(rr)+
...
2
votes
0
answers
91
views
vectorplot show the error message "subset.default(sa, 1) : 'subset' must be logical"
I have been running the following code in RStudio for testing vectorplot functionality in R:
library(raster)
library(rasterVis)
library(lattice)
proj <- CRS('+proj=longlat +datum=WGS84')
df <- ...
2
votes
0
answers
1k
views
loading raster image in tiff format in R
I am trying to load raster image which is in tiff formate in Rstudio. For this I used code
#library (raster)
#library (sp)
#library (rgdal)
#library (tiff)
#wd <- ("E:\\phd\\data\\...
0
votes
1
answer
270
views
How to change labels inside a density plot to a legend on the side?
I have a RasterStack with several 400MB raster files and I want to compare them among each other with the rasterVIS density function. The problem is that the labels of the plot overlap each other. ...
1
vote
1
answer
498
views
Density plot of raster stack
I would like to realize a density plot of raster stack using the package rasterVis in R-CRAN.
I would like to change the colors with which the distribution of my raster values is represented and also ...
4
votes
2
answers
3k
views
R - How to improve color shading of a RasterVis levelplot?
I am trying to improve the color shadings of a levelplot. Please take a look at the code below:
# Load required packages
library(raster)
library(rasterVis)
library(viridis)
# Download file
download....
1
vote
2
answers
3k
views
Modify existing R Color Brewer palette
library(raster); library(rasterVis); library(RColorBrewer)
I want to change the 'Brown Green' theme so that the middle break (140 to 160) is gray.
Is that possible?
Here's an example with the ...
1
vote
1
answer
692
views
How to plot out of bound raster color scale with a specific color in image R?
I have a raster and I want to plot the out of bound color with a specific color in image plot. The code I have so far
## read the libraries
library(raster)
library(fields)
library(grDevices)
##random ...
1
vote
1
answer
299
views
Out of bound colour scale plot in raster
I have a raster and I want to plot it using image(). So far, I plotted the raster with my own color scale col.
## read the libraries
library(raster)
library(fields)
library(grDevices)
##random ...
0
votes
1
answer
776
views
Exporting rasterVis plot without border
I am trying to export rasters from the rasterViz package as jpg or png. I am struggling to:
completely trim white border
keep transparency for NAs
So far:
library(raster)
library(rasterVis)
# Toy ...
0
votes
0
answers
2k
views
R levelplot adjust colour scale
I am trying to adjust my colour scale on a level plot using the rasterVis package. My code plots a raster. I am using manually set colour scale that classifies that data into 5 quantiles. I would like ...
5
votes
1
answer
2k
views
Use animate() with series of levelplots in R raster
I have a time series of 25 yearly land cover rasters. As this is categorical data, I use levelplot(inputRaster) (part of the rasterVis library) to plot a single raster. However, I would like to ...
5
votes
1
answer
599
views
Adding scale labels to levelplot's margins
I'd like to add label showing the values of latitudinal zonal averages to levelplot's gray margin. In the following example, the min and max values for latitudinal means are 286 and 751 respectively. ...
0
votes
1
answer
636
views
levelplot plots the wrong categorical colours
I have received a .tif file alongside a .qml file containing information about the colour for each value (e.g. forest is green, clouds are black).
library(raster)
library(rasterVis)
sm <- raster(...