Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
How to create a bar chart from a CSV file with Haskell (adriansieber.com)
2 points by adius on April 18, 2023 | hide | past | favorite | 1 comment


Been there, done that.

Here's the same functionality in R. Guess who finishes first and takes the afternoon off?

    library(readr)
    library(dplyr)
    library(ggplot2)
    
    df = read_csv('release_data.csv') %>%
        arrange(Date) %>%
        mutate(days = Date - lag(Date))
    
    p = ggplot(df, aes(x = Date, y = days)) +
        geom_col(color = '#008080') +
        scale_x_date(date_minor_breaks = '1 year') +
        labs(title = "Days since last SQLite release")
    
    ggsave("days_since_last_sqlite_release.svg",
           plot = p, device = 'svg', width = 12, height = 7)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: