Hands-On Geospatial Analysis with R and QGIS
上QQ阅读APP看书,第一时间看更新

Looping, functions, and apply family in R

Looping allows us to do repetitive task in a couple of lines of code, saving us much effort and time. Functions allow us to write a block of instructions that could be modified to work according to the way they are being called. Combining the power of looping, functions, and apply family in R allows us to loop through the elements of a data type, or similar, and apply a function or use a block of instructions on each of these.