FAQ
I'd appreciate advice on the following:

I've written an R function
that uses 3 vectors (temperature,
precipitation and potential evapotranspiration)
for a given site, calculates a water budget
(which implies few (<4) iterations), and, from
thresults of this water budget, calculates a number of
bioclimatic indices.

Now I want to calculate these indices
for a large number of sites (arranged
as cells in a raster map), using
monthly raster maps (m rows x n cols) of temperature,
precipitation and potential evapotranspiration.

I do not see any other way than using
two nested for loops and calling the
aforementioned function for each cell in the
map. But this would be a problem in R
as m and n can be ~ 500.

My question is: would it be any better if
I write a simple python function with the loops
and call the R function for each cell (using
the R-Python interface)? Or, as the calculation
in each cell is independent, should I rather write a
shell script with the loop and submit jobs
with R CMD BATCH?

Thanks

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupr-help @
categoriesr
postedDec 13, '02 at 3:12p
activeDec 13, '02 at 3:42p
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Agustin Lobo: 1 post John Zhang: 1 post

People

Translate

site design / logo © 2017 Grokbase