[R-sig-Geo] Fwd: survey
original message Dear all, A survey is underway to understand the current usage, needs and shortcomings of remote sensing for biodiversity research and conservation applications. Please consider filling it out - the estimated time is 10 min. http://remote-sensing-biodiversity.org/survey This survey aims to obtain information from ecologists, conservationists and remote sensing scientists working or interested in this interdisciplinary field in order to understand the needs and challenges of remote sensing applications. The results will be communicated to various groups, including CEOS and GEO BON. Your participation in this survey will help improve remote sensing developments with respect to biodiversity and conservation needs! Please also feel free to forward it to interested colleagues. Best, Martin ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Clipping raster by polygon
Hi Joseph, I wrote a function that you can use to clip every raster object with any polygon within the raster package. ## clip-function(raster,shape) { a1_crop-crop(raster,shape) step1-rasterize(shape,a1_crop) a1_crop*step1} ## Much success. Carsten On 07/17/2013 07:02 PM, Robert J. Hijmans wrote: Joseph, Perhaps you can use raster function crop, perhaps followed by mask. Robert On Wed, Jul 17, 2013 at 8:31 AM, Joseph Miller jemille...@gmail.com wrote: Hello- I am trying to clip a raster with a Spatial Polygons Data Frame (esri shapefile). I reviewed the rgeos package documentation but could not find an adequate tool to do this. Suggestions? Thanks, Joseph [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo -- Carsten Neumann Telegrafenberg, A 17 01.13 14473 Potsdam --- Helmholtz Centre Potsdam GFZ German Research Centre for Geosciences Department 1 - Section 1.4 - Remote Sensing --- Tel.: +49 (0) 331 288 1766 e-mail: carst...@gfz-potsdam.de ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] Intersect Grid and Attributes
Dear, I have 3 files (shape file): the first is a grid (with cells of 500m) covering my study area, the second file is soil moisture (Z1), the third file is vegetation moisture (Z2). When plotting data, Z1 and Z2 fall on the grid on certain cells while other cells are empty. I would like to have for each cell, the coordinates X Y and the values of soil moisture and vegetation moisture corresponding for each cell. So I should have only one file with X Y Z1 Z2. Thank you in advance. Komine -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Intersect-Grid-and-Attributes-tp7584193.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] Fwd: help with matrix
Hi, I am a beginner at R and I would like to get information from a matrix, where the numbers are larger than or equal to 50m . This means that plants need to be apart 50m. I need to get the selection(the results) as a matrix or another object that allows me to identify which pair of species are 50m apart. Attached it is an example... Thanks -- Kátia Emídio da Silva DSc Eng. Florestal Manaus/AM Forestry Engineer Manaus/AM-Brazil -- Kátia Emídio da Silva DSc Eng. Florestal Manaus/AM Forestry Engineer Manaus/AM-Brazil Nauc_calo_1 Nauc_calo_2 Nauc_calo_3 Nauc_calo_4 Nauc_calo_5 Nauc_calo_6 Nauc_calo_1 0 118,74 172,27 152,72 119,45 85,351 Nauc_calo_2 118,74 0 165,8 141,68 67,186 151,47 Nauc_calo_3 172,27 165,8 0 24,331 98,671 104,72 Nauc_calo_4 152,72 141,68 24,331 0 74,673 93,503 Nauc_calo_5 119,45 67,186 98,671 74,673 0 108,95 Nauc_calo_6 85,351 151,47 104,72 93,503 108,95 0 ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Fwd: help with matrix
Hi, Please don't cross-post: choose the most appropriate email list and send your question only to that one. The best place for general questions like this is R-help. On Fri, Jul 19, 2013 at 9:12 AM, Kátia Emidio kat.emi...@gmail.com wrote: Hi, I am a beginner at R and I would like to get information from a matrix, where the numbers are larger than or equal to 50m . This means that plants need to be apart 50m. I need to get the selection(the results) as a matrix or another object that allows me to identify which pair of species are 50m apart. Attached it is an example... Attaching your data isn't nearly as useful as using dput() to include it directly in the email. Many people dislike opening unsolicited attachments, and the mail server strips most of them off anyway. There are almost certainly more elegant ways to accomplish this. Please move the discussion to R-help if you wish to continue it. # recreate your data adist - structure(list(Nauc_calo_1 = c(0, 118.74, 172.27, 152.72, 119.45, 85.351), Nauc_calo_2 = c(118.74, 0, 165.8, 141.68, 67.186, 151.47 ), Nauc_calo_3 = c(172.27, 165.8, 0, 24.331, 98.671, 104.72), Nauc_calo_4 = c(152.72, 141.68, 24.331, 0, 74.673, 93.503 ), Nauc_calo_5 = c(119.45, 67.186, 98.671, 74.673, 0, 108.95 ), Nauc_calo_6 = c(85.351, 151.47, 104.72, 93.503, 108.95, 0)), .Names = c(Nauc_calo_1, Nauc_calo_2, Nauc_calo_3, Nauc_calo_4, Nauc_calo_5, Nauc_calo_6), class = data.frame, row.names = c(Nauc_calo_1, Nauc_calo_2, Nauc_calo_3, Nauc_calo_4, Nauc_calo_5, Nauc_calo_6 )) # identify which elements are = 50 index50 - data.frame(which(adist = 50, arr.ind=TRUE)) # take unique pairs from your symmetric matrix index50 - subset(index50, row col) # get the associated names results50 - data.frame(row = rownames(adist)[index50$row], col = colnames(adist)[index50$col], stringsAsFactors = FALSE) Sarah -- Sarah Goslee http://www.functionaldiversity.org ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Intersect Grid and Attributes
Dear Komine, You could use the raster package to turn your grid into rasters (or stacks) and then use the xyFromCell and values function to get for each cell the coordinates plus the value. Sincerely yours, Lionel On 19/07/2013 15:11, Komine wrote: Dear, I have 3 files (shape file): the first is a grid (with cells of 500m) covering my study area, the second file is soil moisture (Z1), the third file is vegetation moisture (Z2). When plotting data, Z1 and Z2 fall on the grid on certain cells while other cells are empty. I would like to have for each cell, the coordinates X Y and the values of soil moisture and vegetation moisture corresponding for each cell. So I should have only one file with X Y Z1 Z2. Thank you in advance. Komine -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Intersect-Grid-and-Attributes-tp7584193.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Is it possible to calculate the semivariances of a variogram between one specific point and all other points in space?
Dear, I have read with interest this post as it describes exactly what I'm after. the solution proposed seems to be OK, but I wonder whether this point-centered variogram analysis can only be performed as post-processing of the standard variogram outputs, as suggested in this post. Is any of you aware of a function (or modification to the existing variogram function itself) allowing to run variogram analysis based on one-to-all points? thanks for your help, Efisio -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Is-it-possible-to-calculate-the-semivariances-of-a-variogram-between-one-specific-point-and-all-othe-tp7580909p7584198.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Is it possible to calculate the semivariances of a variogram between one specific point and all other points in space?
Hi Efisio I think you are describing a point cumulative semivariogram See the paper by Sen and Oztopal (2001) in Environmetrics 12 401-420 and various other papers by Sen Dont know of any R code for it though cheers Paul - Original Message - From: solazef efisio.sola...@jrc.ec.europa.eu Date: Friday, July 19, 2013 3:19 pm Subject: Re: [R-sig-Geo] Is it possible to calculate the semivariances of a variogram between one specific point and all other points in space? To: r-sig-geo@r-project.org Dear, I have read with interest this post as it describes exactly what I'm after. the solution proposed seems to be OK, but I wonder whether this point-centered variogram analysis can only be performed as post-processing of the standard variogram outputs, as suggested in this post. Is any of you aware of a function (or modification to the existing variogram function itself) allowing to run variogram analysis based on one- to-all points? thanks for your help, Efisio -- View this message in context: http://r-sig- geo.2731867.n2.nabble.com/Is-it-possible-to-calculate-the- semivariances-of-a-variogram-between-one-specific-point-and-all- othe-tp7580909p7584198.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo Paul Harris, National Centre for Geocomputation, National University of Ireland, Maynooth, Co Kildare. Tel: 00353- 0 1-7086204 Fax: 00353- 0 1-7086456 [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] spatial correlation model and variogram
Dear Thierry, Thanks for this useful message. For me to get the initial value of range and nugget, I think I need to get the initial estimate through empirical variogram of the residual from the model. What do you think? I understand your message that to fit other correlation structure models from model which assumes independent of residuals, it has to be model.sph - update(model.vc, corSpher(form = ~easting + northing, nugget = TRUE)) or model.sph - gls(yield ~ 1, corr = CorSpher(form = ~ easting + northing, nugget = TRUE), method=ML) where model.vc-gls(yield~ easting+ northing, method=ML). Since we are interested in modeling the spatial structure of residuals in variogram modelling, am I right to estimate my geostatistical parameters fro, resid - residuals(model.vc) varog-variogram(resid~1,form=~easting + northing) plot(varog) I appreciate you prompt response to my request, please. Thank you. Moshood On Fri, Jul 19, 2013 at 2:04 AM, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: Dear Moshood, Pleasenotethataddingspacestoyourcodemakesyourcodemuchmorereadable You want model.vc - gls(yield ~ easting + northing, method = ML) model.sph - update(model.vc, corSpher(form = ~easting + northing, nugget = TRUE)) which is equivalent to model.sph - gls(yield ~ 1, corr = CorSpher(form = ~ easting + northing, nugget = TRUE), method=ML) Save the residuals and modeling those again is not a good idea. Best regards, Thierry PS I recommend setting some sensible starting values for the range and nugget. With the default range the optimizer tends to get stuck at very small ranges. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2 525 02 51 + 32 54 43 61 85 thierry.onkel...@inbo.be www.inbo.be To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher The plural of anecdote is not data. ~ Roger Brinner The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey -Oorspronkelijk bericht- Van: r-sig-geo-boun...@r-project.org [mailto: r-sig-geo-boun...@r-project.org] Namens Moshood Agba Bakare Verzonden: vrijdag 19 juli 2013 1:22 Aan: r-sig-geo@r-project.org Onderwerp: [R-sig-Geo] spatial correlation model and variogram Dear All, Consider yield as attribute and easting and northing in meters as spatial coordinates. I used gls function of nlme package because of spatial dependency of the residual. I tried to remove large-scale trend by using the easting and northing as covariates of yield. model.vc-gls(yield~easting+northing,method=ML). Being a spatial data, we are most interested in carrying out variogram modelling of the spatial structure on the small-scale component i.e. the residual and equally fit the spatial correlation structure on the residual as well. Do I need to obtain the residual from the model.vc above i.e resid-residuals(model.vc) and fit the other models as follow model.sph-gls(resid~1,corr=CorSpher(form=~easting+northing, nugget=T)) or model.sph-update(model.vc,corSpher(form=~easting+northing,nugget=T)) Please which one is correct. Thank you. Moshood [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo * * * * * * * * * * * * * D I S C L A I M E R * * * * * * * * * * * * * Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is door een geldig ondertekend document. The views expressed in this message and any annex are purely those of the writer and may not be regarded as stating an official position of INBO, as long as the message is not confirmed by a duly signed document. [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] Regression kriging error
Hi, I am trying to do regression kriging with this commands: #Regression modeling regSI - lm(SI~OrgMat+Moisture+pH, data = malpie) summary(regSI) # add residual to malpie malpie$resSI - regSI$residuals # calculate variogram of residual gresSI - gstat(id=resids, formula = resSI~1, data = malpie) vgresSI - variogram(gresSI) plot(vgresSI,plot.nu=T) vgmresSI - fit.variogram(vgresSI, model=vgm(psill=400, range=150, model=Sph, add.to= vgm(psill=100, range=500, model=Sph))) plot(vgresSI, vgmresSI, ylim=c(0,600)) vgmresSI #regression kriging malpie_rk - krige(SI~OrgMat+Moisture+pH, locations=malpie, newdata=zgrid) # regression part only! malpie_rok - krige(residuals(regSI)~1, locations=malpie, newdata=zgrid, model=vgmresSI) # OK of residuals CHALLENGE: the regression part gives me the error message: Error in eval(expr, envir, enclos) : object 'OrgMat' not found. Can someone help me on how to solve this? Israel Ikoyi [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] Singular Matrix Error
Hi All, I want to perform ordinary kriging on a series of air pollution values, but am getting the error / IL.Jul7.ok-krige(Arithmetic.Mean~1, IL.Jul7, model=ILvgm.jul7, newdata=IL2.map) [using ordinary kriging] chfactor.c, line 131: singular matrix in function LDLfactor() Error in predict.gstat(g, newdata = newdata, block = block, nsim = nsim, : LDLfactor/ I know that this error is typically caused by either duplicate points or a variogram without a nugget effect. However, I have neither (see code below). I also have set the same projection for points and prediction grid, plus ran an IDW successfully /[CRS(+proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs)] / / ILvgm.jul7 model psill range 1 Nug 1.537923 0.000 2 Sph 53.045879 266.323 zerodist(IL.Jul7) [,1] [,2] summary(IL.Jul7@data$Arithmetic.Mean) Min. 1st Qu. MedianMean 3rd Qu.Max. 13.50 17.60 21.95 22.82 27.83 32.10 / Any thoughts as to what might be causing this problem? Sorry for not providing a reproducible example, as I can't reproduce it and have run similar code without problems on other data. Thanks for the suggestions. Jesse - Jesse D Berman, PhD Johns Hopkins Bloomberg School of Public Health Department of Environmental Health Sciences Post-Doc -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Singular-Matrix-Error-tp7584203.html Sent from the R-sig-geo mailing list archive at Nabble.com. ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[R-sig-Geo] Choropleth values plotting incorrectly
Hi all, I ran into a spot of trouble today plotting a map of free and reduced lunch students (FRL) in Ohio. linked are: https://drive.google.com/folderview? id=0ByHQd1ckVHrSTURXeU5MczgzWDQusp=sharing shapefile of school districts in Ohio csv of the district data Using the code below I created a choropleth map of Ohio, though the fill in certain school districts was incorrect. For example: according to my csv of data Cleveland Municipal would be in the highest bracket of FRL population, but is not displaying that color. Any thoughts? #Libraries library(maps) library(maptools) library(RColorBrewer) library(class) library(classInt) #Reading in data state - readShapePoly('/Users/Path/to/File/Census2010') dist - read.csv('/Users/Path/to/File/Dist.csv', header = T) #Merging Data OH - state OH@data - merge(OH@data, dist, by.x=NCESID, by.y=NCESID, all.x=F, sort=F ) #Plotting FRL by district plotvar - OH@data$PctFRL nclr - 5 plotclr - brewer.pal(nclr, GnBu) class - classIntervals(plotvar, nclr, style = fixed, fixedBreaks = c(0, 0.40, 0.60, 0.80, 0.90, 1)) legend(bottomleft, legend=names(attr(colcode, table)), fill=attr(colcode, palette), cex=0.6, bty=n) Thanks! [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Re: [R-sig-Geo] Regression kriging error
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/19/2013 05:35 PM, Israel Ikoyi wrote: Hi, I am trying to do regression kriging with this commands: #Regression modeling regSI - lm(SI~OrgMat+Moisture+pH, data = malpie) summary(regSI) # add residual to malpie malpie$resSI - regSI$residuals # calculate variogram of residual gresSI - gstat(id=resids, formula = resSI~1, data = malpie) vgresSI - variogram(gresSI) plot(vgresSI,plot.nu=T) vgmresSI - fit.variogram(vgresSI, model=vgm(psill=400, range=150, model=Sph, add.to= vgm(psill=100, range=500, model=Sph))) plot(vgresSI, vgmresSI, ylim=c(0,600)) vgmresSI #regression kriging malpie_rk - krige(SI~OrgMat+Moisture+pH, locations=malpie, newdata=zgrid) # regression part only! malpie_rok - krige(residuals(regSI)~1, locations=malpie, newdata=zgrid, model=vgmresSI) # OK of residuals CHALLENGE: the regression part gives me the error message: Error in eval(expr, envir, enclos) : object 'OrgMat' not found. Can someone help me on how to solve this? A wild guess: OrgMat is not present, as layer, in zgrid, or in malpie. Providing a reproducible example would allow me to help, instead of wildly guessing. Israel Ikoyi [[alternative HTML version deleted]] ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo - -- Edzer Pebesma Institute for Geoinformatics (ifgi), University of Münster Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251 83 33081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJR6WGRAAoJEM1OCHCtOnfx3i4H/RnZ2aZKUaF9vfz4ssiuGtVY cdYskQo9kLAMM5DUy9a71bse2r0lIfvh2uaPavcqvRMAVGHOTIsbIJk9CIuBTTOw mLPXbg5hEmBIRnbeqty8nGTsyu9us4safAqZcOTsmqsuu9k0PMF8DSwNI/8mxMtr +wJbs8b7mq0p4cphCoh+QoUuCI+lYoW8GeLjj6Aytkj7qS/PA2s7Y296NGmGb6Ad EUhEgPNqLcVPMUeSlwFjGzDSEgkzdrPG89IGmtUKLqsuk0TOBrcdZCAeru+KImgu ts8L8ed4dPVQGGrtbFYUBCD1+HUttldVGNbVfkWF46xeVDDRhwrgmRZ87W7/E0g= =TBWQ -END PGP SIGNATURE- ___ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo