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

Studying spatio-temporal changes in phytoplankton by means of remote sensing

The ocean is teeming with microscopic organisms called phytoplankton. Phytoplankton comprises two main groups: photosynthetic cyanobacteria and the single-celled algae that drift in the sunlit top layers of oceans. They provide food, directly or indirectly for virtually every other marine creature. They emit much of the oxygen that permeates our atmosphere and their fossilized remains, buried and compressed by geological forces, are transformed into oil. In addition, they play a huge role in the cycling of carbon dioxide from the atmosphere to the biosphere and back, cycling that helps to control Earth’s climate [1].air jordan 1

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