Displaying 20 results from an estimated 100 matches similar to: "[newbie] failure to plot a RasterLayer with raster::plot or fields::image.plot"
2013 Apr 26
1
[newbie] how to find and combine geographic maps with particular features?
SUMMARY:
Specific problem: I'm regridding biomass-burning emissions from a
global/unprojected inventory to a regional projection (LCC over North
America). I need to have boundaries for Canada, Mexico, and US
(including US states), but also Caribbean and Atlantic nations
(notably the Bahamas). I would also like to add Canadian provinces and
Mexican states. How to put these together?
General
2012 Aug 28
4
[ncdf4] error converting GEIA data to netCDF
summary: I can successfully ncvar_put(...) data to a file, but when I
try to ncvar_get(...) the same data, I get
> Error in if (nc$var[[li]]$hasAddOffset) addOffset = nc$var[[li]]$addOffset else addOffset = 0 :
> argument is of length zero
How to fix or debug?
details:
R code @
https://github.com/TomRoche/GEIA_to_NetCDF
successfully (if crudely) uses R packages={ncdf4, maps, fields}
2012 Sep 06
1
[Rscript] difficulty passing named arguments from commandline
Wanting a commandline solution (for a problem detailed @
http://mailman.unidata.ucar.edu/mailing_lists/archives/netcdfgroup/2012/msg00279.html
) I turned to Rscript, and whacked out the q'n'd
https://github.com/TomRoche/GEIA_to_netCDF/blob/master/netCDF.stats.to.stdout.r
However it wasn't as quick as hoped, because I spent quite a bit of time
figuring out how to pass the arguments.
2012 Sep 11
2
R equivalent of python module structure and functionality?
summary: how to structure an R file such that it can be both
1. used as a script via, e.g., (from OS commandline)
$ Rscript foo.r bar=baz
2. imported and called as a function via, e.g. (from R commandline)
> source('./foo.r)
> foo(bar='baz')
? I'm looking for the 'R equivalent' of how python supports this
usecase.
details:
As discussed in the thread beginning
2012 May 01
1
[fields:image.plot] subtitle under title (not image)?
summary: how to make image.plot print a subtitle between the title and
the image, rather than under the image?
details:
I've got a project
https://github.com/TomRoche/ioapi-hack-R
that illustrates the use of (et al) the R packages {ncdf4, fields, M3}
for processing and visualizing IOAPI data. The data being visualized
consists of a series of layers (mostly representing emissions from a
2007 Feb 19
0
problem in reading TOMS observed ASCII data file
Hello R Users,
I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS
ozone(O3).
AOD data is on 1x1 grid and O3 data is on 5x5 grid.
First I want to read AOD and O3 as it is and then I want to regrid AOD on
5x5 grid as O3.
Reading is first problem.
FIRST PROBLEM READING AOD:
AOD data is in following format:
#########
Latitute: 89.5
167 0 0 0 0 0 182 0 0 0 0 0 0 0 0 0 0 0 0 200
2007 Feb 19
1
need help in reading TOMS observed ASCII data file
Hello R Users,
I am new to R.
I have two data sets i) TOMS aerosol optical depth(AOD) and ii) TOMS
ozone(O3).
>
> AOD data is on 1x1 grid and O3 data is on 5x5 grid.
>
> First I want to read AOD and O3 as it is and then I want to regrid AOD on
> 5x5 grid as O3.
>
> Reading is first problem.
>
> FIRST PROBLEM READING AOD:
>
> AOD data is in following format:
>
2010 Feb 09
2
Resampling a grid to coarsen its resolution
Dear all,
I have a grid (data frame) dataset at 0.5 x 0.5 degrees spatial resolution (720 columns x 360 rows; regular spacing) and wish to coarsen this to a resolution of 2.5 x 2.5 degrees. A simple calculation which takes the mean of a block of points to form the regridded values would do the trick. Values which should be excluded from the calculation are -9999 (unless all points within a block
2012 May 15
0
Problem with legend and RasterLayer
Dear,
I can't plot legend over a Rasterlayer.
My system is MAC OS Lion.
See my problem:
####### Data
> img
class : RasterLayer
dimensions : 5, 5, 25 (nrow, ncol, ncell)
resolution : 0.002245, 0.002245 (x, y)
extent : -48.33875, -48.32753, -20.35756, -20.34634 (xmin, xmax,
ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0
2011 Feb 12
2
use map.axes for a projected map
Hi,
I am new to R and I want to display longitude and latitude for a projected
map.
map.axes won't do it since it only works for unprojected map.
Can anyone help me with this?
Thanks,
Sybil
--
View this message in context: http://r.789695.n4.nabble.com/use-map-axes-for-a-projected-map-tp3302918p3302918.html
Sent from the R help mailing list archive at Nabble.com.
2013 Feb 13
1
[lattice] display a projected map on a layerplot
summary: I can display a lon-lat map on a lattice::layerplot, and I
can display a Lambert conformal conic (LCC) map on a spam::image, but
I can't display an LCC map on a lattice::layerplot. Example follows.
What am I doing wrong?
details:
I've been using `lattice` (via `rasterVis`) successfully to display
global atmospheric data, which works well enough (though I am
definitely intrigued
2011 Jan 17
2
Difficult with round() function
Dear list,
I'm writing a function to re-grid a data set from finer to coarser
resolutions in R as follows (I use this function with sapply/apply):
gridResize <- function(startVec = stop("What's your input vector"),
to = stop("Missing 'to': How long do you want the fnial vector to be?")){
from <- length(startVec)
shortVec<-numeric()
tics <- from*to
2008 Jul 06
3
Lots of huge matrices, for-loops, speed
Hello,
we have 80 text files with matrices. Each matrix represents a map (rows for
latitude and columns for longitude), the 80 maps represent steps in time. In
addition, we have a vector x of length 80. We would like to compute a
regression between matrices (response through time) and x and create maps
representing coefficients, r2 etc. Problem: the 80 matrices are of the size
4000 x 3500 and we
2009 Apr 06
1
political maps world maps in R, wrld_simpl
dear all,
I'm a newbie in map tools. I was asking to perform an apparently very
simple task.
I have a list of countries (about fifty all over in the world) scored
with a real positive value. Eg
Country score
Italy .56
UK .58
Korea .41
Mexico .63
...
I wish to plot geographical maps where every country is filled with a
color depending on his score.
Using maptools library and
2017 Jun 07
1
Errors running spdplyr example
Dear All,
When I tried to run the following code (taken from the *spdplyr* package
vignettes):
library(spdplyr)
library(maptools)
data(wrld_simpl)
worldcorner <- wrld_simpl %>%
mutate(lon = coordinates(wrld_simpl)[,1], lat =
coordinates(wrld_simpl)[,2]) %>%
filter(lat < -20, lon > 60) %>%
dplyr::select(NAME)
I got the following error messages:
Error in (function (cl,
2009 May 13
1
Overlaying two plots
Hi useR's,
I want to overlay an image plot over a world map and I can do it, but just
not the way I need to do it. Here is the code I am using (with data file
attached) to create my baseline map:
library(sp)
load("TM_WORLD_BORDERS_SIMPL-0.2.RData")
par(bty="l")
plot(wrld_simpl, axes = TRUE, ylim = c(-90, 90), xlim=c(-180, 180), asp=1.5)
lim <- par("usr")
2011 May 31
0
ENC: Using lm() combined with sapply
Hi Caio,
I just replied to a fellow who needed to run a series of regressions changing the dependent variables for the same period. I believe your solution might be similar to that one, just making the window dynamic instead. I used a lapply to store regressions and sapplys to extract stats from the lm()s. Please check the attachment and hope it?s useful.
Filipe Botelho
-----Mensagem
2010 Jun 09
1
[R-sig-Geo] How to extract coordinates values from a shapefile?
I'm not sure if this is what you want. But the function coordinates() in sp
package gives you the coordinates of SpatialObjects.
Regards.
Rodrigo.
2010/6/9 Nikhil Kaza <nikhil.list@gmail.com>
> You need to execute gpclibPermit() to enable gpclib.
>
> library(maptools) should have issued a warning to that effect.
>
>
> Nikhil Kaza
> Asst. Professor,
> City and
2009 Mar 24
1
Variogram with Gstat
Dear all can you help me? i have this problem: i have a dataset in a text file
in a matrix of 3 columns: x, y, z where x and y are the coordinates and Z are
the mesurements. How can i do a variogram with R?
2007 Nov 23
1
ggplo2: fixed extent greater than data?
Hi everyone!
I'm digging into ggplot for some while now, I must say it's great! But - as
some others have posted before, and hadley knows very well himself - the
documentation is lacking some bits...
So I have to pose that question directly:
I'd like to produce a series of maps with different data on, but exactly the
same extent in each plot. Is there a way of switching the