-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
305 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
^LICENSE\.md$ | ||
^README\.Rmd$ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
inst/doc |
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,28 @@ | ||
Package: gamsnip | ||
Title: What the Package Does (One Line, Title Case) | ||
Version: 0.0.0.9000 | ||
Authors@R: | ||
person(given = "First", | ||
family = "Last", | ||
role = c("aut", "cre"), | ||
email = "[email protected]", | ||
comment = c(ORCID = "YOUR-ORCID-ID")) | ||
Description: What the package does (one paragraph). | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
parsnip, | ||
rlang (>= 0.1.2), | ||
magrittr | ||
Suggests: | ||
tidymodels, | ||
modeltime, | ||
knitr, | ||
rmarkdown, | ||
roxygen2, | ||
testthat (>= 3.0.0) | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.1.1 | ||
VignetteBuilder: knitr | ||
Config/testthat/edition: 3 |
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,2 @@ | ||
YEAR: 2021 | ||
COPYRIGHT HOLDER: BUSINESS SCIENCE |
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,21 @@ | ||
# MIT License | ||
|
||
Copyright (c) 2021 BUSINESS SCIENCE | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,22 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export("%>%") | ||
export(":=") | ||
export(.data) | ||
export(as_label) | ||
export(as_name) | ||
export(enquo) | ||
export(enquos) | ||
export(expr) | ||
export(sym) | ||
export(syms) | ||
importFrom(magrittr,"%>%") | ||
importFrom(rlang,":=") | ||
importFrom(rlang,.data) | ||
importFrom(rlang,as_label) | ||
importFrom(rlang,as_name) | ||
importFrom(rlang,enquo) | ||
importFrom(rlang,enquos) | ||
importFrom(rlang,expr) | ||
importFrom(rlang,sym) | ||
importFrom(rlang,syms) |
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,3 @@ | ||
# gamsnip 0.0.0.9000 | ||
|
||
* Added a `NEWS.md` file to track changes to the package. |
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,6 @@ | ||
# linear_gam() - General Interface to Linear GAM Models | ||
# - backend: mgcv | ||
# - prediction: classification, type = class, type = prob. | ||
# See ?predict.model_fit | ||
|
||
# We can add more backends later like brms |
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,4 @@ | ||
# logistic_gam() - General Interface to Logistic GAM Models | ||
# - backend: mgcv | ||
# - prediction: classification, type = class, type = prob. | ||
# See ?predict.model_fit |
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,14 @@ | ||
#' Pipe operator | ||
#' | ||
#' See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. | ||
#' | ||
#' @name %>% | ||
#' @rdname pipe | ||
#' @keywords internal | ||
#' @export | ||
#' @importFrom magrittr %>% | ||
#' @usage lhs \%>\% rhs | ||
#' @param lhs A value or the magrittr placeholder. | ||
#' @param rhs A function call using the magrittr semantics. | ||
#' @return The result of calling `rhs(lhs)`. | ||
NULL |
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,47 @@ | ||
#' Tidy eval helpers | ||
#' | ||
#' @description | ||
#' | ||
#' * \code{\link[rlang]{sym}()} creates a symbol from a string and | ||
#' \code{\link[rlang:sym]{syms}()} creates a list of symbols from a | ||
#' character vector. | ||
#' | ||
#' * \code{\link[rlang:nse-defuse]{enquo}()} and | ||
#' \code{\link[rlang:nse-defuse]{enquos}()} delay the execution of one or | ||
#' several function arguments. \code{enquo()} returns a single quoted | ||
#' expression, which is like a blueprint for the delayed computation. | ||
#' \code{enquos()} returns a list of such quoted expressions. | ||
#' | ||
#' * \code{\link[rlang:nse-defuse]{expr}()} quotes a new expression _locally_. It | ||
#' is mostly useful to build new expressions around arguments | ||
#' captured with [enquo()] or [enquos()]: | ||
#' \code{expr(mean(!!enquo(arg), na.rm = TRUE))}. | ||
#' | ||
#' * \code{\link[rlang]{as_name}()} transforms a quoted variable name | ||
#' into a string. Supplying something else than a quoted variable | ||
#' name is an error. | ||
#' | ||
#' That's unlike \code{\link[rlang]{as_label}()} which also returns | ||
#' a single string but supports any kind of R object as input, | ||
#' including quoted function calls and vectors. Its purpose is to | ||
#' summarise that object into a single label. That label is often | ||
#' suitable as a default name. | ||
#' | ||
#' If you don't know what a quoted expression contains (for instance | ||
#' expressions captured with \code{enquo()} could be a variable | ||
#' name, a call to a function, or an unquoted constant), then use | ||
#' \code{as_label()}. If you know you have quoted a simple variable | ||
#' name, or would like to enforce this, use \code{as_name()}. | ||
#' | ||
#' To learn more about tidy eval and how to use these tools, visit | ||
#' \url{https://tidyeval.tidyverse.org} and the | ||
#' \href{https://adv-r.hadley.nz/metaprogramming.html}{Metaprogramming | ||
#' section} of \href{https://adv-r.hadley.nz}{Advanced R}. | ||
#' | ||
#' @md | ||
#' @name tidyeval | ||
#' @keywords internal | ||
#' @importFrom rlang expr enquo enquos sym syms .data := as_name as_label | ||
#' @aliases expr enquo enquos sym syms .data := as_name as_label | ||
#' @export expr enquo enquos sym syms .data := as_name as_label | ||
NULL |
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,31 @@ | ||
--- | ||
output: github_document | ||
--- | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>", | ||
fig.path = "man/figures/README-", | ||
out.width = "100%" | ||
) | ||
``` | ||
|
||
# gamsnip | ||
|
||
<!-- badges: start --> | ||
<!-- badges: end --> | ||
|
||
The goal of gamsnip is to ... | ||
|
||
## Installation | ||
|
||
Development version: | ||
|
||
``` r | ||
# install.packages("devtools") | ||
devtools::install_github("business-science/gamsnip") | ||
``` | ||
|
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,18 @@ | ||
|
||
<!-- README.md is generated from README.Rmd. Please edit that file --> | ||
|
||
# gamsnip | ||
|
||
<!-- badges: start --> | ||
<!-- badges: end --> | ||
|
||
The goal of gamsnip is to … | ||
|
||
## Installation | ||
|
||
Development version: | ||
|
||
``` r | ||
# install.packages("devtools") | ||
devtools::install_github("business-science/gamsnip") | ||
``` |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,4 @@ | ||
library(testthat) | ||
library(gamsnip) | ||
|
||
test_check("gamsnip") |
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,3 @@ | ||
test_that("multiplication works", { | ||
expect_equal(2 * 2, 4) | ||
}) |
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,2 @@ | ||
*.html | ||
*.R |
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,19 @@ | ||
--- | ||
title: "Getting Started with gamsnip" | ||
output: rmarkdown::html_vignette | ||
vignette: > | ||
%\VignetteIndexEntry{Getting Started with gamsnip} | ||
%\VignetteEngine{knitr::rmarkdown} | ||
%\VignetteEncoding{UTF-8} | ||
--- | ||
|
||
```{r, include = FALSE} | ||
knitr::opts_chunk$set( | ||
collapse = TRUE, | ||
comment = "#>" | ||
) | ||
``` | ||
|
||
```{r setup} | ||
library(gamsnip) | ||
``` |