Statistical computing language and software environment.

learn more… | top users | synonyms

2
votes
1answer
56 views

average certain raster cells in R

If I have two rasters, let's say x1 and x2, that are the same dimensions, how can I take the average of the two but only where both have data to have a third raster x3 that is a composite of the first ...
2
votes
2answers
63 views

Is there a county-level maps dataset that includes independent cities in virginia?

and thank you in advance for your help. The following code shows the dataset I am working with: library(maps) CountyMapData <- map_data("county") head(CountyMapData) long lat group ...
4
votes
3answers
67 views

How can I snap one set of points to another in R

I would like to snap one set of points (SpatialPoints* objects) to another in R using Euclidean distance. I'm hoping for a function like maptools::snapPointsToLines. The attributes of the points ...
0
votes
1answer
172 views

R custom color theme in levelplot

R range(diffRain) [1] -2.59 7.59 How can I code a color ramp following ways? red color ramp less than 0.0 blue color ramp greater than 0.0 This is a part of my code. myTheme <- ...
6
votes
3answers
335 views

1km circles around lat-long-points in many places in world

I have hundreds of lat-long-points spread around the world, and must create circle-polygons around each of them, with radius exactly 1000 meters. I understand the points must first be projected from ...
1
vote
1answer
134 views

Creating new shapefile after merge operation using unionSpatialPolygons

I only recently started playing with shapefiles and R packages for manipulating them. I am looking at creating a new shapefile based on merged polyons by following this example, however, I cannot seem ...
1
vote
1answer
55 views

How to reproduce contour-style labeling with rasterVis::contourplot?

I am currently working with a digital elevation model (DEM) of Mt. Kilimanjaro, Tanzania. The referring raster grid can be downloaded from DIVA-GIS (Country: Tanzania; Subject: Elevation). After ...
2
votes
1answer
125 views

How can i use Kriging inside a Postgis database?

i use a postgis database with temperature data. I want to use a spatial interpolation method but not the supported IDW Method. I need to use the kriging Method. Problem is that its no a part of the ...
3
votes
0answers
26 views

How to set m parameter of clusterR function in R?

I want to manage a clustered computation on raster and thus use the "clusterR" function in R (package 'raster'). However, there's a tuning m parameter to set, but the only explanation about this ...
1
vote
2answers
68 views

Count values greater than 0 in SpatialPolygonsDataframe R

I have a SpatialPolygonsDataframe with > 100 layers and I would like to get a single layer showing the total count of where the values of all the layers are greater than 0. I have tried converting to ...
-1
votes
1answer
71 views

conversion of .img to binary file using R

I have a series of raster images which have to be converted to binary files. I request you to suggest a R code for conversion of all files at a time
3
votes
0answers
51 views

Algorithm to find the boundary grid points [duplicate]

Let us consider a set S consisting of a collection of grid locations (i,j),i,j=1,\ldots,n, in 2-dimensional gridded plane. Here the point (i,j) corresponds to a rectangular grid in the X-Y plane. ...
2
votes
1answer
39 views

Randomly distributed cases according to census data

I'd like to randomly place a point within a geographic boundary with the caveat that I would like to use census data so that points are randomly placed according to population density (i.e. more ...
1
vote
1answer
316 views

Plotting NetCDF file using lat and lon contained in variables

I am trying to plot this NetCDF file (and similar) as a 2d contour map. The file contains a single layer of one variable, "pr". The file has 413x229 X-Y pixel coordinates, and, stored inside the ...
2
votes
1answer
47 views

What can I use for Territory Management in Canada?

For our Canadian organization, I would like to map out the Postal Codes for each sales rep on a map. I've so far used R to pretty good success, but it completely lacks the interactivity I need to ...
1
vote
2answers
206 views

Inserting a zoomed-in plot with a full scale plot in the sp package in R

I am using the sp package in R to plot sampled points along a river. However, I would like to zoom in to a sampled area of the entire river, and plot this zoomed area on the full length of the river. ...
0
votes
2answers
342 views

How to plot the US maps with selected locations (longitude and latitude of the locations are known)?

I've been struggling with the following R plotting of the US map and wonder if any of you have suggestions on how the plot should be done. Here is what I have tried: US <- map("state",fill=TRUE, ...
-1
votes
2answers
103 views

Non Matching Rows between 2 txt files [closed]

I need to compare 2 CSV files so that I can get the missing rows from each CSV. All column attributes in each row should match while comparison. So I have 2 txt files and I would like to compare one ...
-1
votes
1answer
148 views

CSV Format change [closed]

Breakline Input File, Breakline Output file I get a breakline file from a CAD guy in below mentioned format. So I am calling this as a “Input” file. I am calling this as a “Output” file. I would ...
0
votes
1answer
83 views

Multiple Subsetting

Input File, XY min,max file I have a XYZ .csv file for a large portion of an area. I have another txt file which contains Box numbers, Xmin, Ymin, Xmax, Ymax. I would like to export a CSV file for ...
0
votes
1answer
67 views

how to convert list of stack images to timseries files in R

Iam using bfast package for time series analysis. But it requires the files to be read as timeseries Problem: How to convert list of stacked images from 2000 t0 2013 into a time series and given as ...
2
votes
0answers
36 views

how to display the legend when the map contains external icons in R

I haven't found anything about the legend when the map contains icons external R (in png), is't possible to use the legend function or another function in R.
4
votes
1answer
113 views

Working with MODIS in R

I am new to using MODIS data and was hoping to get some help starting out. I have been able to download the hdf file but viewing it in R has been a problem for me. What I have found so far, and ...
9
votes
2answers
134 views

Cleaning blocks pattern from urban LIDAR (blocks uplifted from streets)

We have a 1-meter LIDAR DEM from a city. A small subset can be downloaded from this link: This screenshot shows raw DEM with gray palette (darker belts are streets, and greyish and whitish ...
1
vote
1answer
44 views

R package for geographic regions

Someone told me about a R package with the definition of objects some regions and nations boundaries. I'm trying to find the border of Veneto, an italian region. What's the name of the package? Do you ...
2
votes
2answers
127 views

Convert line shapefile to raster, value=total length of lines within cell

I have a line shapefile representing a road network. I wish to rasterize this data, with the resulting values in the raster showing the total length of the lines that fall within the raster cell. The ...
7
votes
2answers
240 views

How do I convert a tweet into a point in QGIS?

I've been doing some research on using R to datamine twitter, but I haven't really found an answer or a decent tutorial for my question. I'm interested in pulling tweets from twitter with a certain ...
3
votes
1answer
340 views

ggmap: create circle symbol where radius represents distance (miles or km)

I am trying to add a circle around a given latitude and longitude point where the circle size (radius) reflects distance in miles or km. I managed to come up with this example using ggmap, where I ...
1
vote
0answers
40 views

Get pixel values ascii 50 files

I´m working with photos from a cam. The cam is arranged to take ndvi values instead of RGB for each pixel. I have several folders with 50 pictures in each folder as '*.asc' files the pictures. I am ...
3
votes
1answer
106 views

Extract areas of multi-part polygons (SpatialPolygonsDataframe) R

I have a SpatialPolygonsDataframe with multiple polygons, some of these have multiple parts (blue shapes below). In GIS-land it would be easy to get the areas of the individual parts of a multi-part ...
2
votes
1answer
85 views

Extract all unique values from a RGB raster

I have a .png file in RGB format showing the intensity of ship traffic: For my analysis I need to convert it to a one-band raster with values between 0 and 1 where 0 means lowest density and 1 ...
1
vote
1answer
40 views

Another Way to Join a New Column to a DBF if OpenOffice is Giving a “Longer Than the Number of Digits Allowed” Error?

When I need to add a data column to a DBF, I always download the shapefile, open the DBF with OpenOffice for Mac, us a VLOOKUP( ) to add my data to a new column, re-save the file as a DBF, then open ...
0
votes
1answer
100 views

clipping two SpatialPolygons : Error in RGEOSBinTopoFunc

I want to clip two SpatialPolygons on R without success, I followed the article in the disscution How to perform a true GIS clip of polygons layer using a polygon layer in R? Polygone 01 : > ...
0
votes
4answers
88 views

Subsetting a x,y,z into a text file from a large xyz text file

I have a large txt file with x,y,z format. The file size is almost 8 GB. So I don’t want to process in ArcMAP. What I wanted to do is, I have a end coordinates for polygon shapefile and i have ...
1
vote
1answer
59 views

How can we retrieve the values ​​of the intervals in the legend in R

I have an elevation model plotted in R Code: library(raster) data(volcano) r <- raster(volcano) plot(r, col = topo.colors(20)) Plot: how can we retrieve the values ​​of the intervals in the ...
0
votes
1answer
35 views

smoothing a set point in R

I try to smooth R with a set point as follows: myshp <- shapefile("C:/Users/zina/workspace/Proj_Meteo/interpolate/DZA_adm/DZA_adm0.shp") ...
1
vote
0answers
48 views

Assigning widths to string fields using writeOGR() from rgdal?

I am currently working with MapInfo files in the .tab format. I am using R (3.1.0 for Windows) to read and write files in this format, however, I am encountering an issue with writeOGR() from the ...
2
votes
2answers
166 views

Converting LANDSAT-8 TIFF to matrix, data frame, or SpatialGridDataFrame formates

I need to correct the reflectance values of LANDSAT-8 data for steep terrain and find it too tedious and clunky in ArcGIS. The data I have is: LANSDAT-8 DEM (ASTER) Slope and aspect (Derived using DEM ...
1
vote
2answers
35 views

How to see whether a set of postcodes have a typical distribution to the whole postcode population of UK?

For my dissertation I have a dataset of postcodes of 9984 that I am converting to coordinates atm. I looking to find whether this dataset has a 'typical or 'atypical' spatial distribution compared ...
0
votes
1answer
58 views

scatterplot of two rasters in R

I am very very new in programming and I want to ask how can I make a scatterplot of two rasters in R and also get their correlation of determination?
2
votes
0answers
41 views

does the census bureau provide clipped / water-bounded files as nice as certain cities?

this question says they do but when i compare what i can find in the cartographic boundary files section of the census bureau's gis page, they don't look as good as certain shapefiles provided by the ...
1
vote
2answers
110 views

Aggregating satellite night light data in R

I am working in R and having some difficulties with extracting values from a raster layer. What I am trying to do is aggregate satellite night light data from pixel to polygons. However, when I ...
0
votes
0answers
21 views

PostGIS raster write support in R

I want to push/write some generated raster layers to my postgres database directly in R. In theory this could be supported by the rgdal package, but sadly it isn't. In the latest version only copy, ...
1
vote
1answer
82 views

How to clear areas outside map in R

I succeeded thanks to the eblonde in the disscution (problem with polygon smoothing in R) to smoothing polygons in R. Code: inter1= read.table("c:/inter2.csv", header=TRUE) #add a category ...
1
vote
1answer
101 views

Is it possible to create a scatterplot with icons (svg or png) instead of points

I'm just starting with R and I wanted to know if it's possible to create a scatterplot with custom icons (svg or png) instead of points. I started to import a shapefile, and then I have a set of ...
4
votes
1answer
75 views

How to create a map colored by distance to nearest point in R

I'm new to GIS and R-- hope this question makes sense. I have a dataframe(geo07) containing two variables that record the long/lat values for about 6000 points (mat_long & mat_lat). These ...
0
votes
1answer
89 views

How to load postgis raster layers into R?

It is easy to get Vectorlayers into R from a PostgreSQL+PostGIS solution. library(rgdal) dsn="PG:dbname=plots host=localhost user=test password=test" plots = readOGR(dsn,"Plots") But how to do the ...
0
votes
2answers
642 views

Read ESRI shape file (polygon or polyline) in R Environment

How can I read ESRI polygon/polyline shapefile in R environment using rgdal or other library ? can I get a syntax for it ?
1
vote
0answers
29 views

SQLite Driver available with R's rgdal:writeOGR?

Does anybody know how I can get OGR's SQLite Driver to work with R's rgdal package? When listing the drivers in R with the ogrDrivers() command the SQLITE driver is missing..
2
votes
0answers
99 views

Place an image svg into an R plot [duplicate]

I have a set SVG icons (weather icons ) and I want to create a figure with svg superimposed images representation of a Shapefile. below my shapefiles and points representing the position where I ...