---
layout: post
title: "Six approaches to rounding numbers in R (CC253)"
blurb: "round, trunc, floor, ceiling, signif, as.integer"
author: "PD Schloss"
date: 2022-10-03 11:00
comments: false
youtube: gy2jaP_OK_c
start_hash: 329d1f02976d39af2bc6d0ae28965359ef373b5c
end_hash: d80b9db189efa22c7d77162a6e667724519bcf9d
---

Pat compares and contrasts six approaches to rounding numbers in R using the `round`, `floor`, `ceiling`, `trunc`, `signif`, and `as.integer` functions. Then he applies this type of information to a dataset he is analyzing. Along the way he reviews how to use `read_fwf` to read in a fixed-width formatted text file. The overall goal of this project is to highlight reproducible research practices using a number of tools. The specific output from this project will be a map-based visual that shows the level of drought across the globe.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

## Code

You can browse the state of the repository at the

* [beginning of the episode](https://github.com/riffomonas/drought_index/tree/{{page.start_hash}})
* [end of the episode](https://github.com/riffomonas/drought_index/tree/{{page.end_hash}})
