Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| midi <- function(title="R-created Midi", bpm=120){ | |
| ## Creates empty "midi" object that tracks can be inserted into | |
| options(scipen=7) ## avoids writing anything here in scientific notation | |
| ## Create new data.frame and add headers | |
| newdf <- data.frame(matrix(nrow=7,ncol=7)) | |
| names(newdf) <- c("tracknum", "time", "type","channel", "note", "velocity", "tempoonly") | |
| newdf[1,] <- c(0,0, "Header", 1, 1, 480, NA) | |
| newdf[2,] <- c(1,0, "Start_track", NA, NA, NA, NA) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Estonia$newvisitors.absolute <- (Estonia$newvisitors/100) * Estonia$visitors | |
| writeWave(DTMFBenford(Estonia$newvisitors.absolute), "EstoniaNewVisitors_Abs.wav") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| writeWave(DTMFBenford(Estonia$newvisitors), "EstoniaNewVisitors_Percent.wav") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| source("DTMFBenfordFunctions.R") # Loads DTMF functions and requires tuneR package | |
| Estonia <- read.csv("http://scraperwiki.com/scrapers/export/metrixstation/") | |
| writeWave(DTMFBenford(Estonia$pageviews), "EstoniaPageViews.wav") |