'Why does this percent change code output look weird?
The code in question is:
Pct_change <- Precipitation_Final %>% dplyr::mutate(Previous = lag(Precipitation),
Next = lead(Precipitation),
change = Precipitation - Previous,
changePercentage = (change/Previous)* 100)
Below I have include an image including the dataset and the data types that are being used. This shows the percent change however, it is in a weird format and I would like to change it to:
Date / precipitation / Annual_precipitation / changePercentage
1981-01-01 / 0.04 / 2.964 / 24.9
The numbers are not accurate however, that is the formatting I am trying to produce.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
