Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #before running your data should be in the format
- #Day,H00,H01,H02,H03,H04,H05,H06,H07,H08,H09,H10,H11,H12,H13,H14,H15,H16,H17,H18,H19,H20,H21,H22,H23
- #1,9102042,9104990,9107938,9110886,9113834,9116782,9119730,9122678,9125626,9128574,9131522,9134470,9137418,9140366,9143314,9146262,9149210,9152158,9155106,9158054,9161002,9163750,9166498,9169246
- library(tidyverse)
- library(benford.analysis)
- data <- read.csv("hourly.csv")
- data <- data %>%
- pivot_longer(
- cols = starts_with("H"),
- names_to = "hour",
- names_prefix = "H",
- values_to = "pledge",
- values_drop_na = TRUE
- )
- increase <- diff(data$pledge)
- write.table(increase, file = "increase.csv", sep = ",", row.names = FALSE, col.names = FALSE)
- m1 <- benford(increase, number.of.digits = 1)
- m1
- plot(m1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement