Skip to content

Commit

Permalink
added an example
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmayer committed Mar 12, 2015
1 parent b934303 commit 99b79b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/parseBracket.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#' @return a data.table
#' @importFrom data.table fread setcolorder setkeyv :=
#' @export
#' @examples
#' f <- system.file('kaggle_data/sample_submission.csv', package = "kaggleNCAA", mustWork=TRUE)
#' dat <- parseBracket(f)
#' head(dat)
parseBracket <- function(f){
dat <- fread(f)
dat[, id := strsplit(dat$id, '_')]
Expand Down
5 changes: 5 additions & 0 deletions man/parseBracket.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ problems
\note{
Will only have 1 row per game, where team_1 is the lower id team
}
\examples{
f <- system.file('kaggle_data/sample_submission.csv', package = "kaggleNCAA", mustWork=TRUE)
dat <- parseBracket(f)
head(dat)
}

0 comments on commit 99b79b0

Please sign in to comment.