Displaying 20 results from an estimated 6000 matches similar to: "Holding a large number of SEXPs in C++"
2017 Jun 01
3
[spatstat] Convert shapefile to pixel image
Dear all,
I am currently working with the spatstat package, using windows and pixel images.
First:
My aim is to transform a shapefile (see attached) into a pixel image.
My idea is to start transforming the shapefile into a Spatial Polygon file:
x <- readShapeSpatial("200001441.shp")
y <- as(x, "SpatialPolygons")
z <- as.owin(y)
Given z, I want to identify each
2017 Jun 01
0
[spatstat] Convert shapefile to pixel image
On 02/06/17 01:17, Lluis.Hurtado at uv.es wrote:
> Dear all,
>
> I am currently working with the spatstat package, using windows and pixel images.
>
> First:
>
> My aim is to transform a shapefile (see attached) into a pixel image.
>
> My idea is to start transforming the shapefile into a Spatial Polygon file:
>
> x <-
2011 Feb 11
1
Extract a slot value from a 'SpatialPolygons' class object
Dear R-users,
I’m currently trying to extract the value of a slot (area) but can’t find out how to do that.
>str(overlperc)
List of 1
$ :Formal class 'SpatialPolygons' [package "sp"] with 4 slots
.. ..@ polygons :List of 1
.. .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
.. .. .. .. ..@ Polygons :List of 1
.. .. .. .. .. ..$
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 documentation
b <- brick(system.file("external/rlogo.grd",
2009 Jul 16
2
Problems generating image from tiff file
I imported the attached tiff file and converted the coordinate system to
long lat and graphed it:
californiatiff<- readGDAL("california1.tif")
proj4string(californiatiff)
> rasterprojection <- spTransform(californiatiff, CRS("+proj=longlat")
however, when using the plot command for rasterprojection, I get a blob. I
can see the outline of the state of california and
2006 Jan 07
1
maptools, write.polylistShape
Dear Roger,
I am trying to use the write.polylistShape() function of maptools for
the first time and realize that it handles list of polygons of class
'polylist'. However, it seems that no as.polylist() function exist in
the package. The question behind that is: in your opinion, which would
be the best way to convert a list of matrix of polygon nodes
coordinates into an object of
2009 Mar 21
3
Retrieving Vertices Coordinates from SpatialPolygons
Dear List,
I'm trying to use different R packages for my Teaching Assistantship
classes. And I cam out to an (apparently) very simple problem. I would
like to retrieve the vertices coordinate of a SpatialPolygon data. I
know this is stored in the "coords" slot, but I can't get access to
it! I tried to coerce the SpatialPolygon into a data.frame but it
doesn't work.
2009 Mar 02
2
Need help extracting info from XML file using XML package
I have an XML file that has within it the coordinates of some
polygons that I would like to extract and use in R. The polygons are
nested rather deeply. For example, I found by trial and error that I
can extract the coordinates of one of them using functions from the
XML package:
doc <- xmlInternalTreeParse('doc.kml')
docroot <- xmlRoot(doc)
pgon <-
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list,
I am not sure if this request is a "ticket" that should be filled somewhere
outside the mailing list. If so, I apologize for not doing and would like
to know where I should have filled it.
And to the subject matter:
I would like to use a command like this:
plot(c(1,8), 1:2, type="n")
polygon(1:7, c(2,1,2,NA,2,1,2),
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list,
I am not sure if this request is a "ticket" that should be filled somewhere
outside the mailing list. If so, I apologize for not doing and would like
to know where I should have filled it.
And to the subject matter:
I would like to use a command like this:
plot(c(1,8), 1:2, type="n")
polygon(1:7, c(2,1,2,NA,2,1,2),
2016 Apr 27
1
Determine if a set of x and y-latitude points are inside of a polygon using R
Objective: Determine if a set of x and y-latitude points are inside of
a polygon using R.
Lets say I have 9 polygons. Where I have labeled the polygons to be
checked from 1-9. The problem I?m running into is running the
point.in.polygon to check if those points are in one of several
polygons, as my code overwrites the result.
To accomplish this I am using the R-built in function called
2012 Feb 16
2
Defining a viewport scale in {Grid}
Am just feeling my way into the grid library, and cannot figure out how to
define the plot limits. 3/5 of the example polygons below plot in the
default 0-1 range viewport. But when I try to redefine the viewport the
polygons plot in the same places. I also get the same result without
employing push/pop. (As you can see from the scale I'm trying to introduce,
I want to plot map polygons.)
2016 Apr 28
1
polygon angle option perpendicular to axis
The angle is not based on the polygon edges, but it can seem that way if you do not use the asp=1 argument in your plot. Try this example,
> plot(1:10, 1:10, type='n')
> x <- c(1, 3, 5, 3)
> y <- c(3, 5, 3, 1)
> polygon(x, y, angle=0, density=10)
> polygon(x, y + 4.5, angle=45, density=10)
> polygon(x + 4.5, y + 4.5, angle=90, density=10)
> polygon(x + 4.5, y,
2016 Apr 28
0
polygon angle option perpendicular to axis
Filling polygons with lines is a throwback to the time when the height
of quality graphics was the mechanical pen plotter (a device that used
a pen in a mechanical arm to draw the plot on a piece of paper).
Computing and printing technology has advanced quite a bit from that
day, so you may want to reconsider why you want polygons filled with
lines instead of just a solid color (and I consider
2010 Aug 04
1
help with using grid.polygon()
Hi,
I'm trying to use grid.polygon() to plot several polygons at once, with a
view to putting coloured polygons beneath a curve. I'm struggling just to
get the grid.polygon to plot anything
# PLOT SOME POINTS
x <- 1:100
y <- 1:100*0.5 + 3
plot(x, y, pch = ".")
# PLOT 2 POLYGONS
library(grid)
grid.polygon(x = c(20, 20, 40, 40, 40, 40, 60, 60),
y =
2010 Apr 07
1
Struggeling with svydesign()
Dear all,
We are analysing some survey data and we are not sure if we are using
the correct syntax for our design.
The population of interest is a set of 4416 polygons with different
sizes ranging from 0.003 to 45.6 ha, 7460 ha in total. Each polygon has
a binary attribute (presence/absence) and we want to estimate the
probability of presence in the population.
We used sampling with replacement
2016 Apr 27
4
polygon angle option perpendicular to axis
I am trying to use the angle option in polygon to create polygons filled with horizontal and vertical lines. The polygons I am crating are irregular and it the angle function appears to set the angle of the shading perpendicular to the polygon sides rather than perpendicular to the axes. Is there any way to set the angle relative to the axes rather than relative to the polygon sides?
2016 Apr 28
0
polygon angle option perpendicular to axis
Tena koe Simon
plot(1:10, 1:10, type='n')
polygon(c(2,3,6,8), c(2,5,5,3), density=20, angle=90)
polygon(c(2,3,6,8), 5+c(2,5,5,3), density=20, angle=0)
I don't understand your problem. Perhaps if you "provide[d] commented, minimal, self-contained, reproducible code" it would help.
HTH ....
Peter Alspach
-----Original Message-----
From: R-help [mailto:r-help-bounces at
2010 Jun 02
2
Faster union of polygons?
Dear R-helpers,
thanks for yesterday's speeding-up tip. Here is my next query:
I have lots of polygons (not necessarily convex ones, and they never
have holes) given by x,y coordinates.
I want to get the polygon that is the union of these polygons. This is
my current method, but I am hoping there is a faster method (up to
thousands of polygons, each with ca. 40 xy points).
Example:
2011 Nov 18
1
How to fill irregular polygons with patterns?
Hi,
I'm looking the best way to fill irregular polygons with patterns,
Something like the function grid.pattern do, but my case is with
irregular polygons.
Whit this script I can get it, but I'm looking for an "elegant" solution..
library(grid)
grid.polygon(x=c(0.2, 0.8, 0.6, 0.6, 0.8, 0.2),
y=c(0.2, 0.2, 0.3, 0.5, 0.7,0.7),
gp=gpar(fill="grey",