I'm looking for an equivalent of the conditional expression "Con" from arcpy in an open source spatial analysis package. I'd prefer to use QGIS or R.
To provide some additional detail, I need to evaluate some moderately complicated conditional statements in map algebra, e.g., if the value for one raster is above a certain threshold, use one value, but if the value is below that threshold, use a value based on whether another raster value is above or below another threshold, e.g.:
newraster = Con(raster1 < 4, 0, Con(raster2 > 3, 0.5, 1))
Caveat: I have not been able to confirm that the above code will execute, since the machine I'm currently using does not have any ESRI products installed.