Speed up matrix median calculation in R

I decided to write this short post after wasting some hours to optimize my R code to make median calculation possible for some million of values. Hope it can help someone else. The problem is easy to explain and to solve. Median is a very expensive operation to compute as it implies ordination of values, therefore sometimes may considerably slow down the code running time.
air jordan Factory
My example makes use of a list of matrices, like this:

pippo <- list(matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5),matrix(runif(100000),ncol=5))

Continue reading

Landscape configuration and composition analysis with GRASS GIS 7

Landscape configuration and composition metrics summarize the structure of the landscape in a determined area and time. These metrics  are closely related to the occurring ecological patterns (e.g. species distribution) and processes (e.g. biogeochemical cycle). As a consequence they are often used as predictors in ecological modelling. Thereby, a researcher who wants to test whether or not the landscape structure has an influence on the studied ecological properties (i.e., species richness, ecosystem functioning, conservation status, energy flow, animal movements, species dispersion, etc), need a tool to derive them from a Land Use or Land Cover (LULC) map.
Norway nike air max
Continue reading

Biological diversity is raising, for scale’s sake!

Estimating the current trend in direction of biological diversity (or ‘biodiversity’) is not as easy as it looks.
Like the assessment of CO2 concentration in the atmosphere, biological diversity status is key in understanding the amplitude of anthropogenic impact on natural systems and to inform policy.
oakley flip up sunglasses
Continue reading

Parasites and Biological Invasions: Parallels, interactions and control

A few slides from the “Fondazione Edmund Mach” journal club about the enlightening review by Dunn and Hatcher 2015 on the close link existing between parasites and biological invasions. Are parasites just a bizarre side effect of natural selection or they play the lead role in shaping ecosystems and food webs?
air max 2
Continue reading

Forest patches change detection using GRASS and R

As reported here, GRASS 7RC1 has been recently released. In this post I will show how to interface GRASS GIS 7 and R to study the shift in broad-leaved forest land use patches between 1990 and 2006 in Italy. The final result is shown in the figure below. You can see how there has not been so much forest patch movement during the last 20 years in Italy. This is probably due to the quite stable forest coverage in this country (from 28.1 to 30.0 % coverage of land area according to The World Bank data).
green oakley sunglasses
Continue reading