Skip to content

Commit

Permalink
added package skeleton, license and updated description quarto doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelso committed Jun 27, 2024
1 parent 6a7366e commit 2487b42
Show file tree
Hide file tree
Showing 11 changed files with 135 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
^speval\.Rproj$
^\.Rproj\.user$
^_pkgdown\.yml$
^docs$
^pkgdown$
^LICENSE\.md$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ vignettes/*.pdf

# R Environment Variables
.Renviron
.Rproj.user
docs
11 changes: 11 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: speval
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "YOUR-ORCID-ID"))
Description: What the package does (one paragraph).
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2024
COPYRIGHT HOLDER: Gael Sola, Lauri Vesa, Javier Garcia Perez
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2024 Gael Sola, Lauri Vesa, Javier Garcia Perez

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.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Generated by roxygen2: do not edit by hand

11 changes: 4 additions & 7 deletions R/shiny_run_MCredd.R → R/shiny_run_app.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#' Run Monte Carlo for REDD+ uncertainty's shiny app
#' Run the species name validation tool
#'
#' @description Starts a R Shiny application that guide users to fill in context and
#' land use changes for forest related greenhouse gas emissions and removals.
#' Inputs include distribution parameters for various distribution then the app
#' returns error propagation and sensitivity analysis of the overall uncertainty
#' for GHG estimates.
#' @description Starts a R Shiny application that let users upload a list of species names,
#' check them for typos and validate them against several major taxonomic backbones.
#'
#' @param ... arguments to pass to shinyApp
#'
Expand All @@ -20,7 +17,7 @@
#' }
#'
#' @export
shiny_run_MCredd <- function(...) {
shiny_run_app <- function(...) {

## GLOBAL ####################################################################
## Initiate translation
Expand Down
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
url: ~
template:
bootstrap: 5

2 changes: 1 addition & 1 deletion app.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Or use the blue button on top of this file

pkgload::load_all(export_all = FALSE, helpers = FALSE, attach_testthat = FALSE)
MCredd::shiny_run_MCredd()
speval::shiny_run_app()
71 changes: 71 additions & 0 deletions pkg-creation-process.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
title: "Package creation process"
format: html
editor: visual
execute:
eval: false
---

## Initiate package creation

```{r}
## Create package in current RR project directory
usethis::create_package(getwd())
## Add pkgdown skeleton
usethis::use_pkgdown()
```

## Add license

```{r}
usethis::use_mit_license(copyright_holder = "Gael Sola, Lauri Vesa, Javier Garcia Perez")
```

## Add skeleton

The skeleton includes scripts for shiny modules and translation out of the box i the following directories:

- home folder:

- *app.R*: contains code to launch the app on shinyapps.io

- R:

- functions scripts (file name = function name)

- shiny modules scripts (file names like *mod\_\*UI.R* and *mod\_\*\_server.R)*

- *helpers.R*: functions useful for the package development but not exported.

- zzz.R function to make the asset directory from each user package libriary available to the shiny app

- inst/assets:

- images, translation and other files useful for the app.

------------------------------------------------------------------------

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1
```

You can add options to executable code like this

```{r}
#| echo: false
2 * 2
```

The `echo: false` option disables the printing of code (only output is displayed).
13 changes: 11 additions & 2 deletions speval.Rproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
Expand All @@ -11,3 +11,12 @@ Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

0 comments on commit 2487b42

Please sign in to comment.