Giter VIP home page Giter VIP logo

everyday's Introduction

This is the public repository for the book from O'Reilly 'Exploring Everyday Things with R and Ruby'.

There has been some changes in the chapter numbering since the draft

Please send your feedback to me through sausheong at gmail dot com. Any corrections, comments and compliments welcome! :)

Thank yous

Thanks to Ryan LeCompte who pointed out a bug in Chapter 3, which lead to a revamp for all the code in Chapter 3 with better naming (following the examples and figures in the book) and fixing typo bugs raised earlier.

everyday's People

Contributors

azadag avatar batpigandme avatar brideau avatar chrismcg avatar sausheong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

everyday's Issues

some issues in chapter 5

  1. In the code "mails_by_day_of_week.r"
inbox_count <- dates_count(dates=inbox_data['date'], element='%a')
sent_count <- dates_count(dates=sent_data['date'], element='%a')

days_of_week <- c("Mon","Tue","Wed","Thu","Fri","Sat","Sun")

I think you should use %u instead of %a, otherwise the frequency will sort literally as

> test <- function(dates,element) {
+  dates <- as.Date(as.vector(as.matrix(dates)),"%Y-%m-%dT%H:%M:%S")
+ elements <- format(dates, element)
+ data.frame(table(elements))
+ }
> inbox_test <- test(dates=inbox_data['date'], element='%a')
> inbox_test
  elements Freq
1      Fri 1983
2      Mon 1568
3      Sat  142
4      Sun  360
5      Thu 1845
6      Tue 1776
7      Wed 1940

not from Monday to Sunday as the sequence of vector days_of_week.

So the surprising conclusion in the book doesn't exist, email count will reach the low point in the weekend instead of middle of the week. ( Sat/Son sit in positions of Wed/Thu)

this also happened as same in "mails_by_month.r" (use %m instead of %b)

  1. when read from .csv file, an addition option "quote='' " will be better, because some single quote appeared in email address( just like european.vp's(AT)enron.com, nicholas.o'day(AT)enron.com)
-inbox_data <- read.table("inbox_data_enron.csv", header=TRUE, sep=",")
+inbox_data <- read.table("inbox_data_enron.csv", header=TRUE, sep=",",comment.char='',quote='')

I like your book, and things like this even make more fun. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.