search for: spatialpointsdatafram

Displaying 20 results from an estimated 38 matches for "spatialpointsdatafram".

Did you mean: spatialpointsdataframe
2006 Jan 10
0
new gstat version
...a generic; two typical uses are: # "old-style", using data.frame's: library(gstat) data(meuse) data(meuse.grid) v = vgm(0.6, "Sph", 900, 0.1) # spherical variogram model zn.kri1 = krige(log(zinc)~1, ~x+y, meuse, meuse.grid, v) image(zn.kri1) # "new-style", using SpatialPointsDataFrame's: coordinates(meuse) = c("x", "y") # promote meuse to SpatialPointsDataFrame coordinates(meuse.grid) = c("x", "y") # promote to SpatialPointsDataFrame gridded(meuse.grid) = TRUE # promote to SpatialPixelsDataFrame zn.kri2 = krige(log(zinc)~1, meuse, meu...
2006 Jan 10
0
new gstat version
...a generic; two typical uses are: # "old-style", using data.frame's: library(gstat) data(meuse) data(meuse.grid) v = vgm(0.6, "Sph", 900, 0.1) # spherical variogram model zn.kri1 = krige(log(zinc)~1, ~x+y, meuse, meuse.grid, v) image(zn.kri1) # "new-style", using SpatialPointsDataFrame's: coordinates(meuse) = c("x", "y") # promote meuse to SpatialPointsDataFrame coordinates(meuse.grid) = c("x", "y") # promote to SpatialPointsDataFrame gridded(meuse.grid) = TRUE # promote to SpatialPixelsDataFrame zn.kri2 = krige(log(zinc)~1, meuse, meu...
2012 Mar 14
1
How to extend a slot of a class?
Hej hej, is there a way to extend the SpatialPointsDataFrame data slot?This is the structure of an object of it:> str(coord) Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 214 obs. of 2 variables: .. ..$ location.long: num [1:214] -79.8 -79.8 -79.8 -79.8 -79.8 ... .. ..$ lo...
2011 Jan 06
1
Cross validation for Ordinary Kriging
...nfold <- 3 part <- sample(1:nfold, 69, replace = TRUE) sel <- (part != 1) m.model <- x2[sel, ] m.valid <- x2[-sel, ] t<- fit.variogram(v,vgm(0.0437, "Exp", 26, 0)) cv69 <- krige.cv(tsport_ace ~ 1, x2, t, nfold = nrow(x2)) The last line gives an error saying: Error in SpatialPointsDataFrame(coordinates(data), data.frame(matrix(as.numeric(NA), : row.names of data and coords do not match I don't know what is wrong. The x2 data is a SpatialPointsdataframe that is why i did not specify the location (as it will take it from the data). Here is the usage of the function krige.cv...
2010 Jul 20
2
data from SpatialGridDataFrame
Dear All, I have a raster map of the class 'SpatialPointsDataFrame' and coordinates of the class 'SpatialPoints'. I would like to retrieve the values that are contained in the raster map at the specific locations given by the coordinates. Can anyone help me out? Kind regards, Katrin Fleischer
2012 Apr 07
1
rgeos - gBuffer, width by z-value
Dear list! I have problem with buffer size (width) in package rgeos. I would like to expand given geometry (points) to specified width based on the z value from attribute table. Here is example: point <- data.frame(x=c(10,20), y=c(10, 10), z = c(2,7)) point_shp <- SpatialPointsDataFrame(point[,1:2],point) plot(point_shp, xlim = c(0,30), ylim = c(0,20)) plot(gBuffer(point_shp, width = 5, byid=TRUE, capStyle="ROUND"), add = TRUE, col = "red") plot(gBuffer(point_shp, width = point_shp@data$z, byid=TRUE, capStyle="ROUND"), add = TRUE, col = "green&...
2009 Dec 11
3
Please help with a basic function
...<-function(d) { d<-data.frame(d); #convert object to dataframe d<-subset(d,select=c(time,coords.x1,coords.x2)) #select some columns } convert(data) #the problem is that "data" is the same as it was before running the function The objects being processed through my function are SpatialPointsDataFrames but I'm quite sure that's not my problem, as I can process these outside of the function (using the above code) ... it's when I try to wrap the code in a function that it doesn't work. Thanks, Mark [[alternative HTML version deleted]]
2006 Apr 13
2
a question on subset a dataset
Dear R-users, I generate a dataset "d", and want to get a subset from it. ** *z<-rnorm(9) coords<-cbind(x=c(1,1,1,2,2,2,3,3,3),y=c(1,2,3,1,2,3,1,2,3)) d<-SpatialPointsDataFrame(coords, data.frame (z=z[1:9]))* The result*/dataset* is coordinates z 1 (1, 1) 1.41173570 2 (1, 2) 0.18546503 3 (1, 3) -0.04369144 4 (2, 1) -0.21591338 5 (2, 2) 1.46377535 6 (2, 3) 0.22966664 7 (3, 1) 0.10762363 8 (3, 2) -1.37810256 9 (...
2012 Dec 17
2
looping through spatial points and getting counts of spatial points in spatial grid in R
...put should be a table showing the counts of points in the spatial grid. However, since there are many of these spatial points, I want this process to be automated. Can someone help me with this? All my spatial points are in one folder.  # Creating spatial points in R - reading the POI shapefiles as SpatialPointsDataFrame in R autopts.rg <- readOGR(".", "AutoSvc")class (autopts.rg) # Getting a count of the Spatial Points in the Spatial Data Frame in.cell <- overlay(SpatialGrid_LS,FinInstq2) newdata <- data.frame(table(in.cell))View(newdata) "SpatialGrid_LS" is the spatial gri...
2010 Nov 02
0
spatial plots maps-ssplot
Hi all, I have made a plot with ssplot, using a SpatialPointsDataFrame. The content is quite simple, as I have 9 grid points with lon/lat coordinates and 9 values attached to these coordinates. They are in a square area of 3 by 3 gridboxes. I would like to lay a map from maps() over these values, but when I try this, the grids of the maps (smaller) do not overlap...
2011 Oct 04
1
shapefile kriging
I'm new to R and I'm working on point shapefiles. Is there a way that you could interpolate a shapefile via kriging in R using an attribute? All examples on the internet are using txt files and CSVs. Thanks a lot. [[alternative HTML version deleted]]
2010 Sep 24
1
Saving iterative components
Hi, I need help! I am trying to iterate an iterative process to do cross vadation and store the results each time. I have a Spatial data.frame, called Tmese > str(Tmese) Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 14 obs. of 17 variables: .. ..$ ID : int [1:14] 73 68 49 62 51 79 69 77 57 53 ... .. ..$ Stazione: Factor w/ 29 levels "ALIANO","BONIFATI",..: 2 3 4 5 10 11 12 16 17 19 ... .. ..$ X01...
2011 Oct 05
2
kriging shapefiles
Hi! Im new to R and I need to interpolate a shapefile using kriging. I've been able to plot/read the shapefile using the package maptools or rgdal. I've searched the internet for sample codes but most of the kriging codes that I've found done in R is done using txtfiles or CSVs.  An example could be of great help. Thanks. [[alternative HTML version deleted]]
2010 Mar 23
1
Changing content of column in data.frame + efficient join extraction between 2 data.frames
Dear R users, I have 2 SpatialPointsDataFrame's, pcs and East. The column str_1 in the first (pcs) is: > pcs[0:4,] coordinates cat str_1 int_1 int_2 dbl_1 dbl_2 1 (101000, 263000) 1 "SM06B" 101000 263000 4.978915 -4.293668 2 (101000, 265000) 2 "SM06C" 101000 265000 4.960478 -4.266742 3 (1010...
2009 Dec 10
2
plotting with varying dot sizes
...********************************** library(sp) Insitu = read.table("test.csv", skip=3,sep=",") Header = read.table("test.csv", skip=1,sep=",",nrows=1) names(Insitu)= as.character(as.matrix(Header)) CRS_4326 = CRS("+init=epsg:4326") Insitu_sp <- SpatialPointsDataFrame(cbind(Insitu[,"Boylam"],Insitu[,"Enlem"]), data=Insitu, proj4string=CRS_4326) plot(Insitu_sp[,"SPM"],col="black",pch=19,cex=0.725*sqrt(Insitu["SPM"]))
2011 Nov 04
2
How to write a shapefile with projection
...1 ???????? 3375748 ???????????? 8.251 5 610236.1 ???????? 3375747 ???????????? 8.217 6 610236.1 ???????? 3375746 ???????????? 8.196 ? #Get the projection from a raster ?named llev I have loaded before: crs <- projection(llev) ? # get a spatial point data frame from my data crest.sp <- SpatialPointsDataFrame(try[,1:2], try, proj4string=CRS(crs)) ? summary(crest.sp) Object of class SpatialPointsDataFrame Coordinates: ??????? min?????? ??????? max x? 610235.1? ?????? 610354.1 y 3374862.4 ?????? 3375751.4 Is projected: TRUE proj4string : [+proj=utm +zone=15 +ellps=GRS80 +datum=NAD83 +units=m +...
2023 Jan 26
1
akima interp results to zero with less than 10 values
...[1,] NA NA NA NA 34.60000 [2,] NA NA 27.29139 27.11807 26.60971 [3,] NA 19.81371 19.63614 19.12778 18.61943 [4,] NA 14.01443 10.66531 11.13750 10.62914 [5,] NA NA NA NA NA Help page says x, y, and z must be the same length (execpt if x is a SpatialPointsDataFrame) and may contain no fewer than ***four*** points. So my understanding was that 5 poins could be used but I am obviously wrong. Is it a bug in interp or in the documentation or is it my poor understanding of the whole matter. Best regards Petr
2023 Jan 26
1
akima interp results to zero with less than 10 values
...60000 > [2,] NA NA 27.29139 27.11807 26.60971 > [3,] NA 19.81371 19.63614 19.12778 18.61943 > [4,] NA 14.01443 10.66531 11.13750 10.62914 > [5,] NA NA NA NA NA > > Help page says > x, y, and z must be the same length (execpt if x is a > SpatialPointsDataFrame) and may contain no fewer than ***four*** points. > > So my understanding was that 5 poins could be used but I am obviously wrong. > Is it a bug in interp or in the documentation or is it my poor understanding > of the whole matter. > > Best regards > Petr > > > _...
2011 Aug 24
1
setMethods/setGeneric problem when R CMD CHECK'ing a package
...ework/Versions/2.13/Resources/library/STARStools? *** # Note that these "require" statements do not appear in the code, but appear in the DESCRIPTION file: require("sp") require("zoo") # Here are the class definitions (filename AAAclassdefinitions.R): setClass("SpatialPointsDataFrameList",representation(list="list"),contains=c("SpatialPointsDataFrame")) setClass("SpatialPointsDataFrameListZoo",contains=c("SpatialPointsDataFrameList")) # And here is where it is getting hung up. filename "as.yearmon.SpatialPointsDataFrameListZoo...
2014 May 07
2
Mapa de quantiles con spplot
Hola, Lo hice de la forma en que propones y no me sale, no sé si algo esté mal con R, porque no me respeta ni el ?key.space?, me lo sigue poniendo en la parte izquierda del gráfico Saludos El 06/05/2014, a las 02:21, Olivier Nuñez <onunez en unex.es> escribió: > El segundo argumento en spplot ha de definir el número/nombre del intervalo al que > pertenece el area a pintar. >