Skip to content

Commit

Permalink
tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
brunaw committed Jan 27, 2019
1 parent ec7e98f commit 39c8c09
Show file tree
Hide file tree
Showing 220 changed files with 56 additions and 4,402 deletions.
Binary file added .DS_Store
Binary file not shown.
9 changes: 4 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ Maintainer: Bruna Wundervald <brunadaviesw@gmail.com>
Description: Extracts music chords from the 'CifraClub' website <https://www.cifraclub.com.br/>.
The package also has functions for cleaning the extracted data and
feature extraction.
Depends: R (>= 3.2.3)
Depends: R (>= 3.2.4)
Suggests:
ggplot2,
knitr,
network
URL: https://github.com/brunaw/chorrrds
BugReports: https://github.com/brunaw/chorrrds/issues
URL: https://github.com/r-music/chorrrds
BugReports: https://github.com/r-music/chorrrds/issues
License: GPL-2
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
RoxygenNote: 6.1.1
Imports: stringr,
dplyr,
plyr,
XML,
magrittr,
purrr
9 changes: 5 additions & 4 deletions R/clean.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

clean <- function(da, column = "chord", long = 15, message = TRUE){
if(column %in% names(da)){
pat <- da[ , column]
ind <- (stringr::str_length(pat) < long)
filt <- da[ind, ]

filt <- da %>%
dplyr::mutate(long_str = stringr::str_length(!!column)) %>%
dplyr::filter(long_str <= long)
rem <- dim(da)[1] - dim(filt)[1]
if(message){
print(paste0(rem, " lines removed"))
Expand All @@ -34,3 +34,4 @@ clean <- function(da, column = "chord", long = 15, message = TRUE){
}
}
}

Loading

0 comments on commit 39c8c09

Please sign in to comment.