-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy functions not prefixed with "t" any more + dtx_rows()
- Loading branch information
1 parent
9876dfa
commit e5c241e
Showing
12 changed files
with
542 additions
and
647 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
Package: svBase | ||
Type: Package | ||
Version: 1.2.0 | ||
Version: 1.2.1 | ||
Title: 'SciViews' - Functions for Base Objects like Data Frames | ||
Description: Functions to manipulated the three main classes of "data frames" | ||
for 'SciViews': data.frame, data.table and tibble. Allow to select the | ||
|
@@ -12,7 +12,7 @@ Authors@R: c(person("Philippe", "Grosjean", role = c("aut", "cre"), | |
comment = c(ORCID = "0000-0002-2694-9471"))) | ||
Maintainer: Philippe Grosjean <[email protected]> | ||
Depends: R (>= 4.1.0) | ||
Imports: data.table, tibble, dplyr, tidyr, pillar, collapse, vctrs, ellipsis, zeallot | ||
Imports: data.table, collapse, zeallot, tibble, dplyr, tidyr, pillar | ||
Suggests: dtplyr, svMisc, covr, knitr, markdown, rmarkdown, testthat, spelling | ||
License: GPL-2 | ||
URL: https://github.com/SciViews/svBase, https://www.sciviews.org/svBase/ | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#' Row-wise creation of a data frame | ||
#' | ||
#' @description The presentation of the data (see examples) is easier to read | ||
#' than with the traditional column-wise entry in [dtx()]. This could be used | ||
#' to enter small tables in R, but do not abuse of it! | ||
#' | ||
#' @param ... Specify the structure of the data frame by using formulas for | ||
#' variable names like `~x` for variable `x`. Then, use one argument per value | ||
#' in the data frame. It is possible to unquote with `!!` and to | ||
#' unquote-splice with `!!!`. | ||
#' | ||
#' @return A data frame of class **data.frame** for [dtf_rows()], **data.table** | ||
#' for [dtt_rows()], tibble **tbl_df** for [dtbl_rows()] and the default object | ||
#' with [dtx_rows()]. | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' df <- dtx_rows( | ||
#' ~x, ~y, ~group, | ||
#' 1, 3, "A", | ||
#' 6, 2, "A", | ||
#' 10, 4, "B" | ||
#' ) | ||
#' df | ||
dtx_rows <- function(...) { | ||
dtx(tribble(...)) | ||
} | ||
|
||
#' @export | ||
#' @rdname dtx_rows | ||
dtf_rows <- function(...) { | ||
dtf(tribble(...)) | ||
} | ||
|
||
#' @export | ||
#' @rdname dtx_rows | ||
dtt_rows <- function(...) { | ||
dtt(tribble(...)) | ||
} | ||
|
||
#' @export | ||
#' @rdname dtx_rows | ||
dtbl_rows <- function(...) { | ||
tribble(...) | ||
} |
Oops, something went wrong.