Skip to content

Commit

Permalink
formatting and import of :=
Browse files Browse the repository at this point in the history
  • Loading branch information
LudvigOlsen committed Aug 4, 2019
1 parent 8e99555 commit cc63801
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ importFrom(dplyr,group_by)
importFrom(dplyr,group_by_)
importFrom(dplyr,n)
importFrom(dplyr,sample_n)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(utils,combn)
importFrom(utils,head)
Expand Down
2 changes: 1 addition & 1 deletion R/fold.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# R CMD check NOTE handling
if(getRversion() >= "2.15.1") utils::globalVariables(c(".", ":="))
if(getRversion() >= "2.15.1") utils::globalVariables(c("."))

## fold
#' @title Create balanced folds for cross-validation.
Expand Down
1 change: 1 addition & 0 deletions R/sampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ upsample <- function(data,
#' mark_new_rows = TRUE)
#'
#' @importFrom dplyr filter sample_n %>%
#' @importFrom rlang :=
balance <- function(data,
size,
cat_col,
Expand Down
4 changes: 3 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ rvers <- substring(dep, 7, nchar(dep)-1)
# rvers <- gsub('.*(\\\\d+.\\\\d+.\\\\d+).*', '\\\\1', dep)
```

# groupdata2

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/groupdata2)](https://cran.r-project.org/package=groupdata2)
[![metacran downloads](https://cranlogs.r-pkg.org/badges/groupdata2)](https://cran.r-project.org/package=groupdata2)
[![minimal R version](https://img.shields.io/badge/R%3E%3D-`r rvers`-6666ff.svg)](https://cran.r-project.org/)
[![Travis build status](https://travis-ci.org/LudvigOlsen/groupdata2.svg?branch=master)](https://travis-ci.org/LudvigOlsen/groupdata2)
[![Codecov test coverage](https://codecov.io/gh/ludvigolsen/groupdata2/branch/master/graph/badge.svg)](https://codecov.io/gh/ludvigolsen/groupdata2?branch=master)

# groupdata2
## Overview

R package: Methods for dividing data into groups. Create balanced partitions and cross-validation folds.
Perform time series windowing and general grouping and splitting of data. Balance existing groups with up- and downsampling.
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# groupdata2

[![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/groupdata2)](https://cran.r-project.org/package=groupdata2)
[![metacran
downloads](https://cranlogs.r-pkg.org/badges/groupdata2)](https://cran.r-project.org/package=groupdata2)
Expand All @@ -11,7 +13,7 @@ status](https://travis-ci.org/LudvigOlsen/groupdata2.svg?branch=master)](https:/
[![Codecov test
coverage](https://codecov.io/gh/ludvigolsen/groupdata2/branch/master/graph/badge.svg)](https://codecov.io/gh/ludvigolsen/groupdata2?branch=master)

# groupdata2
## Overview

R package: Methods for dividing data into groups. Create balanced
partitions and cross-validation folds. Perform time series windowing and
Expand Down Expand Up @@ -328,6 +330,8 @@ set.seed(1)
df_folded <- fold(df, k = 3, cat_col = 'diagnosis',
num_col = "age",
id_col = 'participant')
#> 'old_name' and 'new_name' were identical.
#> 'old_name' and 'new_name' were identical.

# Show df_folded ordered by folds
df_folded %>%
Expand Down

0 comments on commit cc63801

Please sign in to comment.