[R-sig-Geo] R-sig-Geo Digest, Vol 111, Issue 27

Bill Buckingham wrbuckin at wisc.edu
Thu Nov 29 21:17:18 CET 2012



r-sig-geo-request at r-project.org wrote:

>Send R-sig-Geo mailing list submissions to
>	r-sig-geo at r-project.org
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>or, via email, send a message with subject or body 'help' to
>	r-sig-geo-request at r-project.org
>
>You can reach the person managing the list at
>	r-sig-geo-owner at r-project.org
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of R-sig-Geo digest..."
>
>
>Today's Topics:
>
>   1. Soil/Agricultural modeller position at ISRIC, Wageningen
>      (Tomislav Hengl)
>   2. Geographically weighted model workshop in April 2013 at	the
>      NCG Ireland (Paul Harris)
>   3. Least cost path (hughsturrock)
>   4. Re: Least cost path (Jacob van Etten)
>   5. Re: Least cost path (hughsturrock)
>   6. Re: Writing a rasterBrick into a single NetCDF file
>      (Robert J. Hijmans)
>   7. Re: warning: size of values file does not match the number of
>      cell (Robert J. Hijmans)
>   8. Re: calculate CRPS on rasters (Robert J. Hijmans)
>   9. Re: Faster way of calculating the mean of multiple	ascii
>      files? (Robert J. Hijmans)
>  10. Determining changes in events counts along paths (Aren Cambre)
>  11. Re: Adehabitat crashed R on MacOS 2.15.2 (Els Ducheyne)
>  12. Re: calculate CRPS on rasters (Lorenzo Alfieri)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Wed, 28 Nov 2012 10:53:02 +0100
>From: Tomislav Hengl <hengl at spatial-analyst.net>
>To: R-sig-Geo at r-project.org
>Subject: [R-sig-Geo] Soil/Agricultural modeller position at ISRIC,
>	Wageningen
>Message-ID: <50B5DEFE.8080000 at spatial-analyst.net>
>Content-Type: text/plain; charset=UTF-8; format=flowed
>
>
>For more info see: 
>http://www.academictransfer.com/employer/WUR/vacancy/16419/lang/en/
>
>Job description
>
>A dedicated soil scientist, agricultural studies or physical geographer 
>(MSc or PhD) who will support the aim of ISRIC to allow efficient 
>exchange of soil data between soil scientists and the users community of 
>global development issues and by adding the 4th dimension (time) to our 
>soil information. Strong conceptual abilities are required to 
>scientifically link these issues, especially the use of GIS and remote 
>sensing information in combination with spatial and dynamic modelling. 
>The candidate should have therefore experience in data management in 
>combination with quantitative modelling of soil-water-plant processes, 
>including soil formation processes, land-use change scenarios on 
>degradation and modelling of carbon and water dynamics. Willingness to 
>work in an international environment. Command of French or Spanish is an 
>asset as well as flexibility and sensitivity to interact with multiple 
>cultures.
>
>Requirements
>
>- Soil scientist or physical geographer (MSc or PhD)
>- Experience in spatial database management, GIS and remote sensing
>- Experience in dynamic modelling of soil- and landscape-related processes
>- Experience in teaching or willingness to learn
>- Experience in practical field research is an asset
>- Good interpersonal, communication and writing skills.
>
>Major duties:
>- Develop soil-related modelling approaches to link thematic issues for 
>efficient soil data exchange
>- Develop methods to link remote sensing data, GIS and soil-water-crop 
>modelling by adding the 4th dimension to soil data
>- Understand methodologies for quantitative assessment of global 
>thematic issues, including land and soil degradation, land productivity, 
>availability and dynamics of soil water and carbon
>- Support the development of user friendly toolkits for modelling.
>
>Conditions of employment
>
>Scale 10 with maximum salary of 3755.,- (Euro?s gross per month).
>Social benefits including holiday and ?end of year? allowances.
>Contract duration: 2 years, with annual renewal based on performance and 
>possibility for extension
>Maximum working hours per week: 38
>Contract type: Temporary, 2 jaar
>
>Organisation
>
>Wageningen UR (University & Research centre)
>
>ISRIC ? World Soil Information is an ICSU accredited World Data Centre 
>and has a leading role in international projects aimed at developing a 
>new soil map of the world. Awareness on the importance of soils in 
>global developments has increased in the policy arena and society and it 
>is now widely realized that soils play a key role in food production, 
>climate change, maintenance of biodiversity, production of energy crops 
>and the management of soil water. ISRIC is developing web-based systems 
>to realize its mission and objectives. For more information see 
>www.isric.org
>
>Wageningen University & Research centre
>Delivering a substantial contribution to the quality of life. That's our 
>focus ? each and every day. Within our domain, healthy food and living 
>environment, we search for answers to issues affecting society ? such as 
>sustainable food production, climate change and alternative energy. Of 
>course, we don?t do this alone. Every day, 6,500 people work on ?the 
>quality of life?, turning ideas into reality, on a global scale.
>
>Could you be one of these people? We give you the space you need.
>
>For further information about working at Wageningen UR, take a look at 
>www.wageningenur.nl/en/Jobs.htm.
>
>
>-- 
>T. Hengl
>http://www.wewur.wur.nl/popups/vcard.aspx?id=HENGL001
>
>
>
>------------------------------
>
>Message: 2
>Date: Wed, 28 Nov 2012 11:33:28 +0000 (GMT)
>From: Paul Harris <Paul.Harris at nuim.ie>
>To: R-sig-Geo at r-project.org
>Subject: [R-sig-Geo] Geographically weighted model workshop in April
>	2013 at	the NCG Ireland
>Message-ID: <93f7ca483aef40ba.50b5f688 at nuim.ie>
>Content-Type: text/plain
>
>Dear list
>  We are pleased to announce a three-day workshop on
>  Geographically Weighted Modelling in R
>  being run at the National Centre for Geocomputation, National University of Ireland Maynooth on 24-26 April 2013.
>  For details see
>http://ncg.nuim.ie/redir.php?action=events/20130424
>  Instructors  for the course are: Martin Charlton, Chris Brunsdon (Liverpool  University), Binbin Lu, Isabella Gollini and Paul Harris.
>  For queries and to register for the course - please contact Paul Harris - paul.harris at nuim.ie  - before 31 March 2013.
>  Places are on a 'first come first serve' basis.
>  cheers Paul
>
>
>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]]
>
>
>
>------------------------------
>
>Message: 3
>Date: Wed, 28 Nov 2012 07:20:34 -0800 (PST)
>From: hughsturrock <hughsturrock at hotmail.com>
>To: r-sig-geo at r-project.org
>Subject: [R-sig-Geo] Least cost path
>Message-ID: <1354116034680-7581785.post at n2.nabble.com>
>Content-Type: text/plain; charset=us-ascii
>
>Hi all, 
>
>I am trying to model travel times to from any given point to its nearest
>hospital (in rural Africa). I've been looking at doing this in ArcGIS and R
>and it looks like if I can create a 'cost' raster, there are plenty of
>functions like shortestPath in R {gdistance} and Cost Path in Arc that can
>work this out. This is fine for factors like landcover, where the cost can
>be assumed to be identical irrespective of which direction you are moving
>through that pixel, but I'm having difficulty working out how I would asign
>slope (from an elevation model) a cost given that the cost of a slope
>depends on the direction of travel. Does anyone know of a way to model the
>least costly path over an elevation raster which would account for the
>direction of travel? That way I could look at both travel to and from the
>hospital..
> 
>Thanks! 
>Hugh 
>
>
>
>--
>View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Least-cost-path-tp7581785.html
>Sent from the R-sig-geo mailing list archive at Nabble.com.
>
>
>
>------------------------------
>
>Message: 4
>Date: Wed, 28 Nov 2012 16:19:45 +0000 (GMT)
>From: Jacob van Etten <jacobvanetten at yahoo.com>
>To: hughsturrock <hughsturrock at hotmail.com>,	"r-sig-geo at r-project.org"
>	<r-sig-geo at r-project.org>
>Subject: Re: [R-sig-Geo] Least cost path
>Message-ID:
>	<1354119585.30845.YahooMailNeo at web29701.mail.ird.yahoo.com>
>Content-Type: text/plain
>
>Dear Hugh,
>
>Take a look at the gdistance vignette, example 1.
>
>Best,
>
>Jacob.
>
>
>________________________________
> From: hughsturrock <hughsturrock at hotmail.com>
>To: r-sig-geo at r-project.org 
>Sent: Wednesday, 28 November 2012, 10:20
>Subject: [R-sig-Geo] Least cost path
>
>Hi all, 
>
>I am trying to model travel times to from any given point to its nearest
>hospital (in rural Africa). I've been looking at doing this in ArcGIS and R
>and it looks like if I can create a 'cost' raster, there are plenty of
>functions like shortestPath in R {gdistance} and Cost Path in Arc that can
>work this out. This is fine for factors like landcover, where the cost can
>be assumed to be identical irrespective of which direction you are moving
>through that pixel, but I'm having difficulty working out how I would asign
>slope (from an elevation model) a cost given that the cost of a slope
>depends on the direction of travel. Does anyone know of a way to model the
>least costly path over an elevation raster which would account for the
>direction of travel? That way I could look at both travel to and from the
>hospital..
>
>Thanks! 
>Hugh 
>
>
>
>--
>View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Least-cost-path-tp7581785.html
>Sent from the R-sig-geo mailing list archive at Nabble.com.
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 5
>Date: Wed, 28 Nov 2012 09:40:47 -0800 (PST)
>From: hughsturrock <hughsturrock at hotmail.com>
>To: r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] Least cost path
>Message-ID: <1354124447953-7581788.post at n2.nabble.com>
>Content-Type: text/plain; charset=us-ascii
>
>Great, thanks everyone. Very helpful!
>
>
>
>--
>View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Least-cost-path-tp7581785p7581788.html
>Sent from the R-sig-geo mailing list archive at Nabble.com.
>
>
>
>------------------------------
>
>Message: 6
>Date: Wed, 28 Nov 2012 11:18:30 -0800
>From: "Robert J. Hijmans" <r.hijmans at gmail.com>
>To: Mark Payne <markpayneatwork at gmail.com>
>Cc: r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] Writing a rasterBrick into a single NetCDF
>	file
>Message-ID:
>	<CANtt_hztDjBUJX1736Bk3KUb_Cnj6O_6Cm=H=co+ySFBAKyj-Q at mail.gmail.com>
>Content-Type: text/plain
>
>Mark,
>That is a good suggestion that I will implement.
>Thanks,
>Robert
>
>On Tue, Nov 27, 2012 at 3:56 AM, Mark Payne <markpayneatwork at gmail.com>wrote:
>
>> Hi,
>>
>> I have a rasterStack with several layers. I would like to write this
>> into a single NetCDF file, where each layer is stored as a variable.
>> Is there anyway that this can be done? At the moment (raster 2.0-31),
>> the layers are written as a third dimension, rather than than as
>> separate variables. I can see situations where people might want to do
>> both, so maybe an options switch to writeRaster could be a good
>> solution?
>>
>> Cheers,
>> Mark
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 7
>Date: Wed, 28 Nov 2012 11:22:50 -0800
>From: "Robert J. Hijmans" <r.hijmans at gmail.com>
>To: Mark Payne <markpayneatwork at gmail.com>
>Cc: r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] warning: size of values file does not match
>	the number of cell
>Message-ID:
>	<CANtt_hzrZdNyzf-QAR06wBE5XYGu8CaJw4pMpu3Lai6WmPXXiA at mail.gmail.com>
>Content-Type: text/plain
>
>Mark,
>
>It means that aggregate create a temporary file (because it is a large
>dataset) that is not correct. Given then number of cells and the datatype,
>the file should have a certain size, which apparently it has not. A common
>cause of this is a full disk (temp folder) which you can perhaps fix with
>removeTmpFiles.
>It could be because of a bug in aggregate. It could be a false alarm.  Can
>yo send me the print of  "min.bath" and of "file.info
>(filename(min.bath))$size"
>
>Robert
>
>
>On Tue, Nov 27, 2012 at 3:37 AM, Mark Payne <markpayneatwork at gmail.com>wrote:
>
>> Hi,
>>
>> I have a large raster file (netcdf) that I am trying to process ie
>>
>> > bathr
>> class       : RasterLayer
>> dimensions  : 10800, 21600, 233280000  (nrow, ncol, ncell)
>> resolution  : 0.01666667, 0.01666667  (x, y)
>> extent      : -180, 180, -90, 90  (xmin, xmax, ymin, ymax)
>> coord. ref. : NA
>> data source : /work/up/common/bathymetry/ETOPO1/ETOPO1_Ice_c_gmt4.nc
>> names       : z
>> values      : -10803, 8333  (min, max)
>> zvar        : z
>>
>> Processing this with aggregate() gives the following warning:
>>
>> > min.bath <- aggregate(bathr,fact=out.agg,fun=min,expand=FALSE)
>> Warning message:
>> In .rasterFromRasterFile(grdfile, band = band, objecttype) :
>>   size of values file does not match the number of cells (given the data
>> type)
>>
>> What does this warning mean? I've seen previously on the list that
>> there was a bug associated with this warning - the message has only
>> appeared for me since upgrading from about raster 2.0-12 (can't
>> remember the exact version, unfortunately) to 2.0-31.
>>
>> Best wishes,
>>
>> Mark
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 8
>Date: Wed, 28 Nov 2012 11:25:36 -0800
>From: "Robert J. Hijmans" <r.hijmans at gmail.com>
>To: Lorenzo Alfieri <alfios17 at hotmail.com>
>Cc: R-sig-geo_Forum <r-sig-geo at r-project.org>
>Subject: Re: [R-sig-Geo] calculate CRPS on rasters
>Message-ID:
>	<CANtt_hzGYYEk38TgYws+npfLwAg2Z6VG1fv0GW9YHjQiCvhbVw at mail.gmail.com>
>Content-Type: text/plain
>
>Lorenzo,
>
>Given that solution, I think you can also express this (in a memory-safe
>fashion) like this :
>
>CRPS  <- overlay(obs, pred, fun=function(x,y) crps(x, y)$crps)
>
>Robert
>
>On Tue, Nov 27, 2012 at 3:11 AM, Lorenzo Alfieri <alfios17 at hotmail.com>wrote:
>
>>
>> Etienne,
>> thank you for the tip
>> Now it runs trough, by using
>>
>> CRPS <- raster(ncol=10, nrow=10)
>> CRPS[] <- crps(obs[],pred[])$crps
>>
>> Lorenzo
>>
>>
>> Date: Mon, 26 Nov 2012 21:37:13 -0500
>> Subject: Re: [R-sig-Geo] calculate CRPS on rasters
>> From: etiennebr at gmail.com
>> To: alfios17 at hotmail.com
>> CC: r-sig-geo at r-project.org
>>
>> Lorenzo,
>>
>> I don't know about your specific function, but you can access matrix using
>> the []'s. So maybe something like :
>> CRPS <- raster(ncol=10, nrow=10)
>> CRPS[] <- crps(obs[],pred[])
>>
>>
>> Etienne
>>
>> 2012/11/26 Lorenzo Alfieri <alfios17 at hotmail.com>
>>
>> CRPS <- raster(ncol=10, nrow=10)
>>
>> for (i in 1:length(obs)){
>>
>>   CRPS[i] <- crps(obs[i],pred[i])$CRPS
>>
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 9
>Date: Wed, 28 Nov 2012 11:32:59 -0800
>From: "Robert J. Hijmans" <r.hijmans at gmail.com>
>To: Swen Meyer <s.meyer at lmu.de>
>Cc: r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] Faster way of calculating the mean of
>	multiple	ascii files?
>Message-ID:
>	<CANtt_hw24Bg984zPe9jsEXQ_sy9Ch56RR=yXi2f+k-4SFvMOsA at mail.gmail.com>
>Content-Type: text/plain
>
>Swen,
>
>You do not provide much info (e.g. system.time() ) so I do not know where
>the bottleneck is. It could be in the call to "stack" which you can speed
>up with "quick=TRUE" (if you are sure that the rasters all line up). It
>could also be that the bottleneck is reading the data from file.
>Using ASCII is not a good idea (slow) in this type of application.
>If you have enough RAM, you might try reading all files in one step,
>instead of blocks:
>
>X_01 <- stack(Files[which(substring(**Files,(nchar(Files)-9),nchar(**
>Files)-6)==i)])
>X_01 <- readAll(X_01)  # this will fail if you have insufficient RAM
>X_01_sum <- mean((X_01))
>
>Robert
>
>
>
>On Mon, Nov 26, 2012 at 7:51 AM, Swen Meyer <s.meyer at lmu.de> wrote:
>
>> Dear All,
>> I�m trying to process a couple of ascii grids (daily grids): size of one
>> grid (344kb). the header of the ascii grids look like this:
>> ncols 288
>> nrows 199
>> xllcorner 506255
>> yllcorner 4.35899e+006
>> cellsize 30
>>
>> I have daily grids over 30 years and I like to find a fast way of
>> calculating the monthly means for every month of those 30 years:
>> the file structure is like this: grid1: "sb05_dem30m_20410101.024"
>> grid2: "sb05_dem30m_20410102.024"
>> grid3: "sb05_dem30m_20410103.024"
>> ...
>> gridn: "sb05_dem30m_YYYYMMdd.024"
>> ...
>> last grid: "sb05_dem30m_20701231.024"
>>
>> At the moment I�using R Vers. 2.15.1 on a Intel PC i5 CPU 760@ 2.80GHz
>> 2.80GHz with 4GB RAM Windows7, and the raster package and this is my script:
>> library(raster)
>>
>> setwd("G:\\hydro_modelling\\**Sardinia\\Wasim\\**RioCostara30m\\KNMI_REF\\
>> **output30m\\RUN2\\UNSATZON\\")
>> Path="G:\\hydro_modelling\\**Sardinia\\Wasim\\**RioCostara30m\\KNMI_REF\\*
>> *output30m\\RUN2\\SOILMOIST\\"
>>
>>
>> x="sb05_dem30m_"
>> #list files of folder with string x
>> Files=list.files(pattern=x)
>> # select files to process
>> Files=Files[which((substring(**Files,nchar(Files)-3,nchar(**
>> Files)))==".024")]
>>
>> for( i in unique(substring(Files,(nchar(**Files)-9),nchar(Files)-6))){
>> print(i)
>> #stack files
>> X_01 <- stack(Files[which(substring(**Files,(nchar(Files)-9),nchar(**
>> Files)-6)==i)])
>> #mean the grid with raster package
>> X_01_sum <- mean((X_01))
>> #Write monthly mean asci grid
>> writeRaster(X_01_sum, filename=paste(Path,"**
>> SoilMoisture_RM_Mean_",i,sep="**"), "ascii")
>> }
>>
>> The script works, but it takes more than 30 min until the grids are
>> precessed. Does anyone know of a faster way of meaning (summing) those
>> grids and exporting them as a asci again?
>> Best regards and thank you in advance,
>> Swen
>>
>> --
>> ------------------------------**------------------------------**--
>> Dipl. - Geogr. Swen Meyer
>> Department of Geography
>> Physical Geography and Environmental Modeling Ludwig-Maximilian University
>> of Munich
>>
>> Luisenstrasse 37
>> 80333 Munich/Germany
>> fon: +49 (0)89 2180-6665
>> fax: +49 (0)89 2180-6675
>> email: s.meyer at lmu.de
>> web: www.geographie.uni-muenchen.de
>>
>> ______________________________**_________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>
>
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 10
>Date: Wed, 28 Nov 2012 20:15:29 -0600
>From: Aren Cambre <aren at arencambre.com>
>To: r-sig-geo at r-project.org
>Subject: [R-sig-Geo] Determining changes in events counts along paths
>Message-ID:
>	<CAA1mBrqvciDPhQ6j6i7eo6TYFmyf5Xr8em39AMX+3m3T48yX-g at mail.gmail.com>
>Content-Type: text/plain
>
>I have a road network and a set of events that occurs on the road network.
>
>I want to spot areas where there are significant changes in the amount of
>these events over time.
>
>I have proposed dividing the map into a grid and comparing event counts in
>each square between successive time periods. For example, I could use a
>grid with 1000 meter x 1000 meter squares and do a month-by-month
>comparison.
>
>This might be "good enough", but it still has two weaknesses:
>
>   1. A significant change in events could be diluted if the "center of
>   mass" of these events' locations or times lies near a grid boundary or near
>   the time division.
>   2. The grid size has to be a compromise between being large enough to
>   catch clusters of events yet small enough to not include too many unrelated
>   roadways.
>
>I think a better approach would be one that traverses paths and is able to
>organically spot these areas of changes over time. Another might be to
>overlay an offset grid and offset time over the original data to overcome
>the problem I identified in #1, although the end effect may not be much
>different than smaller grid and time slices.
>
>Any thoughts on this?
>
>Aren
>
>	[[alternative HTML version deleted]]
>
>
>
>------------------------------
>
>Message: 11
>Date: Thu, 29 Nov 2012 09:19:59 +0100
>From: Els Ducheyne <educheyne at avia-gis.be>
>To: Mathieu Basille <basille at ase-research.org>
>Cc: Els Ducheyne <educheyne at avia-gis.be>, r-sig-geo at r-project.org
>Subject: Re: [R-sig-Geo] Adehabitat crashed R on MacOS 2.15.2
>Message-ID: <729C9E16-0F5A-4C23-9D22-A59BF2241D26 at avia-gis.be>
>Content-Type: text/plain; charset=windows-1252
>
>Dear Mathieu and Massimo
>Yes, that did the trick, installation of the framework solved the issue both on command line as in R GUI
>Thanks for the help.
>
>Could this be added to the documentation of the packages (the same issue occurs with adehabitatHS)
>
>Best and thanks again
>Els
>On 27 Nov 2012, at 17:25, Mathieu Basille <basille at ase-research.org> wrote:
>
>> Dear Els,
>> 
>> I can't really help on the Mac OS issue with tcl/tk since I'm using Linux. However, as the command line warning tells you, you'd better use 'adehabitatHS' [1] now, instead of the old 'adehabitat', which is no longer developed (bug fixes are added, but no new methods). I don't think it will solve your problem, though, but I really recommend to upgrade. Besides, you might want to have a look at the MADIFA instead of the ENFA. See [2] for further details.
>> 
>> Best,
>> Mathieu Basille.
>> 
>> 
>> [1] http://cran.r-project.org/web/packages/adehabitatHS/index.html
>> 
>> [2] Calenge, C.; Darmon, G.; Basille, M.; Loison, A. & Jullien, J.-M. (2008) The factorial decomposition of the Mahalanobis distances in habitat selection studies. Ecology, 89: 555-566 doi 10.1890/06-1750.1
>> 
>> 
>> Le 27/11/2012 10:57, Els Ducheyne a ?crit :
>>> Dear Massimo
>>> yes it works from command line, I do get a warning about the tcl tk though, so indeed this must be the source of the problem (see below)
>>> The good news is that at least I can carry out the code via the terminal if necessary (even it is not with the R Gui)
>>> Still hoping for a fix though
>>> Els
>>> 
>>> R version 2.15.2 (2012-10-26) -- "Trick or Treat"
>>> Copyright (C) 2012 The R Foundation for Statistical Computing
>>> ISBN 3-900051-07-0
>>> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>>> 
>>> R is free software and comes with ABSOLUTELY NO WARRANTY.
>>> You are welcome to redistribute it under certain conditions.
>>> Type 'license()' or 'licence()' for distribution details.
>>> 
>>>   Natural language support but running in an English locale
>>> 
>>> R is a collaborative project with many contributors.
>>> Type 'contributors()' for more information and
>>> 'citation()' on how to cite R or R packages in publications.
>>> 
>>> Type 'demo()' for some demos, 'help()' for on-line help, or
>>> 'help.start()' for an HTML browser interface to help.
>>> Type 'q()' to quit R.
>>> 
>>> [Previously saved workspace restored]
>>> 
>>>> library(adehabitat)
>>> Loading required package: ade4
>>> 
>>> Attaching package: ?ade4?
>>> 
>>> The following object(s) are masked from ?package:base?:
>>> 
>>>     within
>>> 
>>> Loading required package: tkrplot
>>> Loading required package: tcltk
>>> Loading Tcl/Tk interface ... done
>>> Loading required package: shapefiles
>>> Loading required package: foreign
>>> 
>>> Attaching package: ?shapefiles?
>>> 
>>> The following object(s) are masked from ?package:foreign?:
>>> 
>>>     read.dbf, write.dbf
>>> 
>>> Be careful: it is now recommended to use the newpackages adehabitatMA, adehabitatLT, adehabitatHR, and adehabitatHS.
>>> These 4 packages are intended to become the future of adehabitat.
>>> The "classical" version of adehabitat will still be maintained for some
>>> time, but no new method will be added to the package.
>>> 
>>> Warning message:
>>> In fun(libname, pkgname) :
>>>   Can't find a usable tk.tcl in the following directories:
>>>     /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5/Resources/Scripts ./lib/tk8.5 ./lib/tk8.5/Resources/Scripts ~/Library/Tcl/tk8.5 ~/Library/Tcl/tk8.5/Resources/Scripts /Library/Tcl/tk8.5 /Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/tk8.5 /System/Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/8.5/tk8.5 /System/Library/Tcl/8.5/tk8.5/Resources/Scripts ~/Library/Frameworks/tk8.5 ~/Library/Frameworks/tk8.5/Resources/Scripts /Library/Frameworks/tk8.5 /Library/Frameworks/tk8.5/Resources/Scripts /System/Library/Frameworks/tk8.5 /System/Library/Frameworks/tk8.5/Resources/Scripts ./library
>>> 
>>> 
>>> 
>>> This probably means that tk wasn't installed properly.
>>>> sessionInfo()
>>> R version 2.15.2 (2012-10-26)
>>> Platform: i386-apple-darwin9.8.0/i386 (32-bit)
>>> 
>>> locale:
>>> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
>>> 
>>> attached base packages:
>>> [1] tcltk     stats     graphics  grDevices utils     datasets  methods
>>> [8] base
>>> 
>>> other attached packages:
>>> [1] adehabitat_1.8.11 shapefiles_0.6    foreign_0.8-51    tkrplot_0.0-23
>>> [5] ade4_1.4-17
>>>> 
>>> 
>>> On 27 Nov 2012, at 16:42, rpi <distem at rpi.edu> wrote:
>>> 
>>>> Els,
>>>> 
>>>> i tried to run adehabitat form inside the Gui.app (64 bit) using R
>>>> (installed from Homebrew )
>>>> 
>>>> .. and i got the same problem you had
>>>> 
>>>> i tried to rebuild the  gui.app using Xcode but no lucky .. same crash.
>>>> 
>>>> trying to run R from the command line ? it is able to load adehabitat.
>>>> 
>>>> seems to me a GUI.app problem
>>>> 
>>>> ..  can you check if your adehabitat code runs fine starting R from command line ?
>>>> 
>>>> thanks,
>>>> 
>>>> Massimo.
>>>> 
>>>> 
>>>> Il giorno 27/nov/2012, alle ore 09:34, Els Ducheyne <educheyne at avia-gis.be> ha scritto:
>>>> 
>>>>> Dear Massimo
>>>>> I've just tried and it is still the same problem. Should I put it somewhere for R to find this?
>>>>> 
>>>>> Best
>>>>> Els
>>>>> 
>>>>> On 27 Nov 2012, at 15:03, epi <massimodisasha at gmail.com> wrote:
>>>>> 
>>>>>> did you tried to install XQuartz ?
>>>>>> 
>>>>>> http://xquartz.macosforge.org/landing/
>>>>>> 
>>>>>> --Massimo.
>>>>>> 
>>>>>> 
>>>>>> Il giorno 27/nov/2012, alle ore 09:00, Els Ducheyne <educheyne at avia-gis.be> ha scritto:
>>>>>> 
>>>>>>> Dear list
>>>>>>> I am trying to run ENFA for presence only records. I have installed adehabitat v1.18.11 on R2.15.2 on MacOS 10.8.2. I
>>>>>>> Whilst the library is successfully installed and loaded, it crashed R when I am trying to run other commands after loading the library.
>>>>>>> Did anyone experience this before?
>>>>>>> Is it the Tcl/Tk that causes the problem, could I load the package without the Tcl/Tk?
>>>>>>> I have tested under windows too with same version of adehabitat and R and there it works fine. Unfortunately, I will use the package for teaching and some students use MacOS so therefore I would like to find a solution.
>>>>>>> 
>>>>>>>> sessionInfo()
>>>>>>> R version 2.15.2 (2012-10-26)
>>>>>>> Platform: i386-apple-darwin9.8.0/i386 (32 bit)
>>>>>>> 
>>>>>>> locale
>>>>>>> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
>>>>>>> 
>>>>>>> attached base packages:
>>>>>>> stats graphics grDevices utils datasets methods base
>>>>>>>> library(adehabitat)
>>>>>>> Loading required package: ade4
>>>>>>> Attaching package: 'ade4'
>>>>>>> The following objects are masked from 'package:base'
>>>>>>> within
>>>>>>> loading required package:tkrplot
>>>>>>> loading required package: tcltk
>>>>>>> Loading Tcl/Tk interface
>>>>>>>> sessionInfo()
>>>>>>> 
>>>>>>> After the second sessionInfo() R does not respond, nor with any other command. The only option is Force quit and reboot.
>>>>>>> 
>>>>>>> Thanks for any help
>>>>>>> Els
>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> R-sig-Geo mailing list
>>>>>>> R-sig-Geo at r-project.org
>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> R-sig-Geo mailing list
>>>>> R-sig-Geo at r-project.org
>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>>> 
>>>> 
>>> 
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>> 
>> 
>> -- 
>> 
>> ~$ whoami
>> Mathieu Basille, PhD
>> 
>> ~$ locate --details
>> University of Florida \\
>> Fort Lauderdale Research and Education Center
>> (+1) 954-577-6314
>> http://ase-research.org/basille
>> 
>> ~$ fortune
>> ? Le tout est de tout dire, et je manque de mots
>> Et je manque de temps, et je manque d'audace. ?
>> -- Paul ?luard
>
>
>
>------------------------------
>
>Message: 12
>Date: Thu, 29 Nov 2012 10:15:24 +0100
>From: Lorenzo Alfieri <alfios17 at hotmail.com>
>To: <r.hijmans at gmail.com>
>Cc: R-sig-geo_Forum <r-sig-geo at r-project.org>
>Subject: Re: [R-sig-Geo] calculate CRPS on rasters
>Message-ID: <DUB107-W649F6E7FC94975EE3E9E28D75C0 at phx.gbl>
>Content-Type: text/plain; charset="iso-8859-1"
>
>
>Hi Robert,
>I was hoping to use the overlay function too, but it seems it doesn't work in this case. See the result:
>
>CRPS? <- overlay(obs, pred, fun=function(x,y) crps(x,y)$crps)
>
>Error in function (x, fun, filename = "", recycle = TRUE, ...)? : 
>? cannot use this formula, probably because it is not vectorized
>
>Lorenzo
>
>
>
>Date: Wed, 28 Nov 2012 11:25:36 -0800
>Subject: Re: [R-sig-Geo] calculate CRPS on rasters
>From: r.hijmans at gmail.com
>To: alfios17 at hotmail.com
>CC: etiennebr at gmail.com; r-sig-geo at r-project.org
>
>Lorenzo,
>Given that solution, I think you can also express this?(in a memory-safe fashion)?like this :
>CRPS??<- overlay(obs, pred, fun=function(x,y) crps(x, y)$crps)
>
>Robert
>
>On Tue, Nov 27, 2012 at 3:11 AM, Lorenzo Alfieri <alfios17 at hotmail.com> wrote:
>
>
>
>
>Etienne,
>
>thank you for the tip
>
>Now it runs trough, by using
>
>
>
>CRPS <- raster(ncol=10, nrow=10)
>
>CRPS[] <- crps(obs[],pred[])$crps
>
>
>
>Lorenzo
>
>
>
>
>
>Date: Mon, 26 Nov 2012 21:37:13 -0500
>
>Subject: Re: [R-sig-Geo] calculate CRPS on rasters
>
>From: etiennebr at gmail.com
>
>To: alfios17 at hotmail.com
>
>CC: r-sig-geo at r-project.org
>
>
>
>Lorenzo,
>
>
>
>I don't know about your specific function, but you can access matrix using the []'s. So maybe something like :
>
>CRPS <- raster(ncol=10, nrow=10)
>
>CRPS[] <- crps(obs[],pred[])
>
>
>
>
>
>Etienne
>
>
>
>2012/11/26 Lorenzo Alfieri <alfios17 at hotmail.com>
>
>
>
>CRPS <- raster(ncol=10, nrow=10)
>
>
>
>for (i in 1:length(obs)){
>
>
>
>? CRPS[i] <- crps(obs[i],pred[i])$CRPS
>
>
>
>? ? ? ? [[alternative HTML version deleted]]
>
>
>
>_______________________________________________
>
>R-sig-Geo mailing list
>
>R-sig-Geo at r-project.org
>
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> 		 	   		  
>
>
>------------------------------
>
>_______________________________________________
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org
>https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>End of R-sig-Geo Digest, Vol 111, Issue 27
>******************************************


More information about the R-sig-Geo mailing list