From mestre.frederico at gmail.com  Tue Sep 29 12:52:44 2015
From: mestre.frederico at gmail.com (Frederico Mestre)
Date: Tue, 29 Sep 2015 11:52:44 +0100
Subject: [Rd] Error possibly related with environments/namespace
Message-ID: <CAPfBvqx=AQ-VQmXWDaJzi68=5BdBuyUyf9XxpkVw8_kGviaikA@mail.gmail.com>

Hello all,

I've got a problem with a function in a R package I've developed
(MetaLandSim).

One of the outputs of my function is the plotting of four images (combining
a graph and a map). This plotting is made in a graphical device, with the
graph in one side and the map in the other.

My function works perfectly fine until it has to plot the map. Then it
stops and I get an error.

However if I load the exact same function in R it runs perfectly well.

This has something to do with environments, but I can't understand whats
wrong. It is also related with the plotting, since if I set the argument
plot.directions to FALSE I get no error.

Here's the code:

#Loading packages
library(MetaLandSim)
library(rgrass7)

#Loading required data
data(rg_exp)

#Loading required maps
presences <- system.file("examples/presences.asc", package="MetaLandSim")
mask <- system.file("examples/landmask.asc", package="MetaLandSim")

#Start  GRASS using rgrass7
initGRASS("C:/Program Files (x86)/GRASS GIS 7.0.0", home=tempdir())

#Running function
range.map <- range_raster(presences.map=presences, re.out=rg_exp,
mask.map=mask,plot.directions=TRUE)


Cheers,
Frederico Mestre
?

	[[alternative HTML version deleted]]



[Rd] Error possibly related with environments/namespace
Frederico Mestre