code

Working with Raster Dataset in R

Masumbuko Semba
We begin with answering the questions. And the possible reason to reach the goal is to define questions like; what is a raster dataset? What tools/functions are used to import raster in R? How to I work with and plot raster data in R How missing or bad data in R are handled with R Objectives Describe the fundamental attributes of a raster dataset Explore raster attributtes and metadata Import raster dataset into R workspace visualize raster object Distinguish single versus multi-bands rasters Introduction to Raster data This this section introduce you to the fundamental principles, packages and metadata/raster attributes that are needed to work with raster data in R.

Control flow in R

Masumbuko Semba
R
One of the prime purposes of using a computer is to automate a task that would be very tedious to perform by hand. The usual implication is that some task is to be performed over and over again in some systematic way. This chapter will be concerned with the programming concept of a control flow, a feature that is at the heart of nearly every computer algorithm. The two important control flows statements are* count-controlled* loops like for loops and conditional statements such as if-else construct.

Reshaping data with tidyr

Masumbuko Semba
One of the key task in data preparation is to organize thee dataset in a way that makes analysis and plottng easier. In practice, the data is often not stored like that and the data comes to us with repeated observations included on a single row. This is often done as a memory saving technique or because there is some structure in the data that makes the ‘wide’ format attractive.

Manipulating Data with dplyr

Masumbuko Semba
Before a dataset can be analysed in R, its often manipulated or transformed in various ways. For years manipulating data in R required more programming than actually analyzing data. That has improved dramatically with the dplyr package. It provides programmers with an intuitive vocabulary for executing data management and analysis tasks. Hadley Wickham [-@dplyr], the original creator of the dplyr package, refers to it as a Grammar of Data Manipulation.

Importing data in R

Masumbuko Semba
You can lean R with the dataset it comes with when you install it in your machine. But sometimes you want to use the real data you or someone gathered already. One of critical steps for data processing is to import data with special format into R workspace.Data import refers to read data from the working directory into the workspace. In this chapter you will learn how to import common files into R.