Re: [R-sig-Geo] Request for help about running a loop and reading .NC files

2020-03-23 Thread Bhaskar Mitra
Hi Ben, Rolf, Thanks for your help. Ben : the code works perfectly. thanks once again, bhaskar On Mon, Mar 23, 2020 at 4:17 PM Ben Tupper wrote: > Hi, > > Rolf is correct that you might consider enclosing your nc_open(...) with > try(nc_open(...)), and then testing if the value returned by

Re: [R-sig-Geo] Request for help about running a loop and reading .NC files

2020-03-23 Thread Ben Tupper
Hi, Rolf is correct that you might consider enclosing your nc_open(...) with try(nc_open(...)), and then testing if the value returned by try() inherits from the "try-error" class. If there is no problem opening the NCDF file, then it will return an "ncdf4" class object. Also, you might isolate

Re: [R-sig-Geo] [FORGED] Request for help about running a loop and reading .NC files

2020-03-23 Thread Rolf Turner
On 24/03/20 10:52 am, Bhaskar Mitra wrote: Hello Everyone, I have written a loop which reads hundreds of .nc files and extract information from each .nc file and exports that corresponding information as a csv file. The loop works fine until it encounters a .nc file which it cannot read and

[R-sig-Geo] Request for help about running a loop and reading .NC files

2020-03-23 Thread Bhaskar Mitra
Hello Everyone, I have written a loop which reads hundreds of .nc files and extract information from each .nc file and exports that corresponding information as a csv file. The loop works fine until it encounters a .nc file which it cannot read and the loop stops. I would appreciate if anyone

Re: [R-sig-Geo] issue when opening raster image in R, the pixel values a rescaled somehow

2020-03-23 Thread Roger Bivand
Please make the file in question available for download (url), or the url you downloaded it from (no login), on this list. It looks as though the unsigned 16 bit integer is not right. Roger Bivand Norwegian School of Economics Bergen, Norway Fra: R-sig-Geo p�

[R-sig-Geo] issue when opening raster image in R, the pixel values a rescaled somehow

2020-03-23 Thread Victor F. Rodriguez Galiano
I opened a Geotiff image in R using the raster function. However, the image seems to be rescaled. The minimum and maximum values should be 13607 and 15461 but are 275 and 305. The Geotiff image when opened in a GIS is correct but not in R. This is my code: Script: library(raster)

Re: [R-sig-Geo] Modifications of the methods in resample() function using raster package

2020-03-23 Thread ASANTOS via R-sig-Geo
Thanks Frederico, But at this moment, I'll try to reduce steps (extract() - focal() - resample()) and using only resample() function to change the number of nearest cells, if is possible. First, in "bilinear" method, I'll like to change the function for work with the different number of

Re: [R-sig-Geo] ENFA specialization values

2020-03-23 Thread Adrian Dwiputra
Hi Ruth, I had some experience with ENFA 5 years ago. Based on what I wrote back then, I didn’t interpret the specialization values as is, but instead they were aggregated into the overall (global) specialization index and then converted into the tolerance value by simply inverted it (x becomes

Re: [R-sig-Geo] Modifications of the methods in resample() function using raster package

2020-03-23 Thread Frederico Faleiro
Hi Alexandre, you can use extract from raster (check the examples in the help page). Depending of your data you can create a spatial polygon that cover the number of cells you want and define the summary function or use the buffer argument. Best regards, Frederico Faleiro Postdoctoral

[R-sig-Geo] Convert rectilinear to regular grid in R (stars and raster)

2020-03-23 Thread Frederico Faleiro
Dear all, I am trying convert netCDF data from rectilinear to regular grid in R, but I am not sure what is the best approach for it. I would like to convert the grid modifying the original resolution only when necessary. In some cases I must change resolution to keep regular cell size and cover

[R-sig-Geo] ENFA specialization values

2020-03-23 Thread Aschim, Ruth
Hello, I am running an ENFA analysis and am having trouble interpreting the specialization values. Do the specialization values correspond to each ecogeographical variable? If so they don't make sense in terms of what I am seeing for the marginality values, i.e. marginality value for water is

[R-sig-Geo] Modifications of the methods in resample() function using raster package

2020-03-23 Thread ASANTOS via R-sig-Geo
Dear r-sig-geo members, ??? I?ve like to know the possibility of make some modifications in resample() function in raster package. First, in "bilinear" method by default is assigns a weighted average of the four nearest cells, and I?ll like to change for five and six nearest cells, too, is

Re: [R-sig-Geo] "spdep": check whether a spatial model fully controls for spatial correlation

2020-03-23 Thread Roger Bivand
On Sun, 22 Mar 2020, Gary Dong wrote: Thank you, Roger. I ran Hausman.test() for both my spatial error model (p-value < 2.2e-16) and my spatial Durbin error model (p-value = 3.693e-11). My understanding of these two tests is that my SDEM performs better than my SEM, but there is still room