From 0425dd0b9d6fe51327770ac5350693fb647d26e8 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Thu, 14 Nov 2024 11:53:58 -0700 Subject: [PATCH] Initial commit --- .Rbuildignore | 4 ++ .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 49 +++++++++++++++++++++++++ .gitignore | 7 ++++ DESCRIPTION | 16 ++++++++ NAMESPACE | 5 +++ R/RcppExports.R | 12 ++++++ R/egpkg-package.R | 3 ++ README.Rmd | 56 ++++++++++++++++++++++++++++ README.md | 57 +++++++++++++++++++++++++++++ egpkg.Rproj | 21 +++++++++++ man/figures/README-pressure-1.png | Bin 0 -> 7324 bytes man/rcpp_hello_world.Rd | 17 +++++++++ src/.gitignore | 3 ++ src/RcppExports.cpp | 32 ++++++++++++++++ src/rcpp_hello_world.cpp | 18 +++++++++ 16 files changed, 301 insertions(+) create mode 100644 .Rbuildignore create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 .gitignore create mode 100644 DESCRIPTION create mode 100644 NAMESPACE create mode 100644 R/RcppExports.R create mode 100644 R/egpkg-package.R create mode 100644 README.Rmd create mode 100644 README.md create mode 100644 egpkg.Rproj create mode 100644 man/figures/README-pressure-1.png create mode 100644 man/rcpp_hello_world.Rd create mode 100644 src/.gitignore create mode 100644 src/RcppExports.cpp create mode 100644 src/rcpp_hello_world.cpp diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..f11ab17 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,4 @@ +^.*\.Rproj$ +^\.Rproj\.user$ +^\.github$ +^README\.Rmd$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..a3ac618 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..56843bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +src/*.o +src/*.so +src/*.dll diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..f11a912 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,16 @@ +Package: egpkg +Type: Package +Title: What the Package Does in One 'Title Case' Line +Version: 1.0 +Date: 2023-02-23 +Author: Your Name +Maintainer: Your Name +Description: One paragraph description of what the package does as + one or more full sentences. +License: GPL (>= 2) +Imports: + Rcpp +LinkingTo: Rcpp +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.2.3 +Encoding: UTF-8 diff --git a/NAMESPACE b/NAMESPACE new file mode 100644 index 0000000..8f279de --- /dev/null +++ b/NAMESPACE @@ -0,0 +1,5 @@ +# Generated by roxygen2: do not edit by hand + +export(rcpp_hello_world) +importFrom(Rcpp,evalCpp) +useDynLib(egpkg, .registration = TRUE) diff --git a/R/RcppExports.R b/R/RcppExports.R new file mode 100644 index 0000000..03501a9 --- /dev/null +++ b/R/RcppExports.R @@ -0,0 +1,12 @@ +# Generated by using Rcpp::compileAttributes() -> do not edit by hand +# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +#' Hello world from Rcpp +#' @return A list with two vectors (`x`, `y`). +#' @examples +#' rcpp_hello_world() +#' @export +rcpp_hello_world <- function() { + .Call(`_egpkg_rcpp_hello_world`) +} + diff --git a/R/egpkg-package.R b/R/egpkg-package.R new file mode 100644 index 0000000..d488f21 --- /dev/null +++ b/R/egpkg-package.R @@ -0,0 +1,3 @@ +#' @importFrom Rcpp evalCpp +#' @useDynLib egpkg, .registration = TRUE +NULL diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 0000000..42aa185 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,56 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# egpkg + + +[![R-CMD-check](https://github.com/UofUEpiBio/egpkg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UofUEpiBio/egpkg/actions/workflows/R-CMD-check.yaml) + + +The goal of egpkg is to ... + +## Installation + +You can install the development version of egpkg from [GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("UofUEpiBio/egpkg") +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +```{r example} +library(egpkg) +## basic example code +``` + +What is special about using `README.Rmd` instead of just `README.md`? You can include R chunks like so: + +```{r cars} +summary(cars) +``` + +You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this. You could also use GitHub Actions to re-render `README.Rmd` every time you push. An example workflow can be found here: . + +You can also embed plots, for example: + +```{r pressure, echo = FALSE} +plot(pressure) +``` + +In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN. diff --git a/README.md b/README.md new file mode 100644 index 0000000..57e039d --- /dev/null +++ b/README.md @@ -0,0 +1,57 @@ + + + +# egpkg + + + +[![R-CMD-check](https://github.com/UofUEpiBio/egpkg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/UofUEpiBio/egpkg/actions/workflows/R-CMD-check.yaml) + + +The goal of egpkg is to … + +## Installation + +You can install the development version of egpkg from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("UofUEpiBio/egpkg") +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +``` r +library(egpkg) +## basic example code +``` + +What is special about using `README.Rmd` instead of just `README.md`? +You can include R chunks like so: + +``` r +summary(cars) +#> speed dist +#> Min. : 4.0 Min. : 2.00 +#> 1st Qu.:12.0 1st Qu.: 26.00 +#> Median :15.0 Median : 36.00 +#> Mean :15.4 Mean : 42.98 +#> 3rd Qu.:19.0 3rd Qu.: 56.00 +#> Max. :25.0 Max. :120.00 +``` + +You’ll still need to render `README.Rmd` regularly, to keep `README.md` +up-to-date. `devtools::build_readme()` is handy for this. You could also +use GitHub Actions to re-render `README.Rmd` every time you push. An +example workflow can be found here: +. + +You can also embed plots, for example: + + + +In that case, don’t forget to commit and push the resulting figure +files, so they display on GitHub and CRAN. diff --git a/egpkg.Rproj b/egpkg.Rproj new file mode 100644 index 0000000..270314b --- /dev/null +++ b/egpkg.Rproj @@ -0,0 +1,21 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes +StripTrailingWhitespace: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source +PackageRoxygenize: rd,collate,namespace diff --git a/man/figures/README-pressure-1.png b/man/figures/README-pressure-1.png new file mode 100644 index 0000000000000000000000000000000000000000..e208f61cdb5ecd0e71c372902595d01b5baaede4 GIT binary patch literal 7324 zcmds6XH-+$wpPlagA_qPKv1NKC`F_MB2}b|fOHY1_fBZW22$iG(jf%ty>|i#(o2F6 zfzUxh4Lt!ufEUqo@44^KyW_n##v9}P$QV0wtv%ZXl`=Qt$=gyIy)6;sSO8k5N{CN@*5>ir9GBPr9a`Hd^_=AFi zf|8Pwii(Pwnwo}&hL)C=j*gC=o}Ph$;lhOrjEsy-Oiawo%q%P{7cX99Wo2b!W4m*IXQWGc>n;QprD|rs0aiC@7=qnq@<**tgND*(m{>gww0>FMk1KYaMmz`)?qqeq5@hDJt4#>U2vA3ruRF)=kYH8V3a zH#fJiu&}hWw6d~#^5luNwe{1dPi<^$o;`c^{P}ZRTU$FjJ9~S32L}g7M@J_oCue78 z7Z(>-S64STH+Oe;4-XGdPfsr|FK=&eA0HoIUtd2zKYxG!fPerH2ox9?7!(u~92^`H z5)v93`r^e4Fc|#u<;z#EUcG+(`pug+Z{NNR3kwSm4}bUWT|`7gWMpJiR8(|y^!xYk zV`5_d{PWKbA3l8i_%Sv%_S2_NadC0+@$m@>35kh`Nl8h`$;l}xDXFQcX=!N?2qZl{ z9SVhJWMq8){5dl-Gb<}AJ3BikCnq;IH!m+QKR>^qprEj@u&Ai0xVX5aq@=X8w5+VG zyu7@kqN1|0vZ|`8y1Kfirlz*Gwyv(OzP`Spp`o#{v8kyE27@&>H@CF3w6?Z>`SPW$ zt*yPi{p;7S9UUE=ot<4>UEST?Jv}|Wy}f;Xef|CY0|NttgM)B59DzU#4Gn$!_HB50 zcw}S*i9~+?{(W?GbZl&Fe0&^*LQPCeOioTtO-)TtPtVNE%+Aiv&CSiv&o3-2{P^)> zad8oiMlUTbEiW&xtgNiAuCA@Et*@_RFqn;vjm^!?t*x!??d_eNo!#Bty}dmw7K_8- z_V@P>4h{|v5Ak^X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c7H|YQX literal 0 HcmV?d00001 diff --git a/man/rcpp_hello_world.Rd b/man/rcpp_hello_world.Rd new file mode 100644 index 0000000..0a9f57e --- /dev/null +++ b/man/rcpp_hello_world.Rd @@ -0,0 +1,17 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/RcppExports.R +\name{rcpp_hello_world} +\alias{rcpp_hello_world} +\title{Hello world from Rcpp} +\usage{ +rcpp_hello_world() +} +\value{ +A list with two vectors (\code{x}, \code{y}). +} +\description{ +Hello world from Rcpp +} +\examples{ +rcpp_hello_world() +} diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..22034c4 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,3 @@ +*.o +*.so +*.dll diff --git a/src/RcppExports.cpp b/src/RcppExports.cpp new file mode 100644 index 0000000..4433333 --- /dev/null +++ b/src/RcppExports.cpp @@ -0,0 +1,32 @@ +// Generated by using Rcpp::compileAttributes() -> do not edit by hand +// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 + +#include + +using namespace Rcpp; + +#ifdef RCPP_USE_GLOBAL_ROSTREAM +Rcpp::Rostream& Rcpp::Rcout = Rcpp::Rcpp_cout_get(); +Rcpp::Rostream& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get(); +#endif + +// rcpp_hello_world +List rcpp_hello_world(); +RcppExport SEXP _egpkg_rcpp_hello_world() { +BEGIN_RCPP + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; + rcpp_result_gen = Rcpp::wrap(rcpp_hello_world()); + return rcpp_result_gen; +END_RCPP +} + +static const R_CallMethodDef CallEntries[] = { + {"_egpkg_rcpp_hello_world", (DL_FUNC) &_egpkg_rcpp_hello_world, 0}, + {NULL, NULL, 0} +}; + +RcppExport void R_init_egpkg(DllInfo *dll) { + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); +} diff --git a/src/rcpp_hello_world.cpp b/src/rcpp_hello_world.cpp new file mode 100644 index 0000000..fe62d77 --- /dev/null +++ b/src/rcpp_hello_world.cpp @@ -0,0 +1,18 @@ + +#include +using namespace Rcpp; + +//' Hello world from Rcpp +//' @return A list with two vectors (`x`, `y`). +//' @examples +//' rcpp_hello_world() +//' @export +// [[Rcpp::export]] +List rcpp_hello_world() { + + CharacterVector x = CharacterVector::create( "foo", "bar" ) ; + NumericVector y = NumericVector::create( 0.0, 1.0 ) ; + List z = List::create( x, y ) ; + + return z ; +}