-
Notifications
You must be signed in to change notification settings - Fork 4
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
0 parents
commit 4c4ad3e
Showing
45 changed files
with
3,622 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,7 @@ | ||
^.*\.Rproj$ | ||
^\.Rproj\.user$ | ||
^data-raw$ | ||
dev_history.R | ||
^dev$ | ||
$run_dev.* | ||
^README\.Rmd$ |
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,141 @@ | ||
golem::fill_desc( | ||
pkg_name = "MetaShARK", # The Name of the package containing the App | ||
pkg_title = "metashark", # The Title of the package containing the App | ||
pkg_description = "MetaShARK is a Shiny application allowing its | ||
user to fill metadata for a given ecological | ||
dataset of his owns. The data description relies | ||
on Ecological Metadata Language (EML).", # The Description of the package containing the App | ||
author_first_name = "Elie", # Your First Name | ||
author_last_name = "ARNAUD", # Your Last Name | ||
author_email = "[email protected]", # Your Email | ||
repo_url = "https://github.com/earnaud/MetaShARK.git" # The (optional) URL of the GitHub Repo | ||
) | ||
getwd() | ||
golem::set_golem_options() | ||
usethis::use_readme_rmd( open = FALSE ) | ||
{usethis} | ||
usethis | ||
## 1.3 - Add a data-raw folder | ||
## | ||
## If you have data in your package | ||
usethis::use_data_raw( name = "resources", open = FALSE ) # Change "my_dataset" | ||
usethis::use_data_rax | ||
usethis::use_data_raw | ||
golem::use_recommended_tests | ||
normalizePath | ||
interactive() | ||
golem::use_recommended_tests() | ||
golem::use_recommended_deps() | ||
# Add helper functions | ||
golem::use_utils_ui() | ||
golem::use_utils_server() | ||
# You're now set! | ||
# go to dev/02_dev.R | ||
rstudioapi::navigateToFile( "dev/02_dev.R" ) | ||
## 2.1 Add modules | ||
## | ||
golem::add_module( name = "modules/my_first_module" ) # Name of the module | ||
## 3.1 Vignette | ||
usethis::use_vignette("MetaShARK") | ||
# You're now set! | ||
# go to dev/03_deploy.R | ||
rstudioapi::navigateToFile("dev/03_deploy.R") | ||
# You're now set! | ||
# go to dev/03_deploy.R | ||
rstudioapi::navigateToFile("dev/03_deploy.R") | ||
install.packages("rhub") | ||
devtools::test() | ||
#' Run the Shiny Application | ||
#' | ||
#' @export | ||
#' @importFrom shiny shinyApp | ||
#' @importFrom golem with_golem_options | ||
run_app <- function(...) { | ||
with_golem_options( | ||
app = shinyApp(ui = app_ui, server = app_server), | ||
golem_opts = list(...) | ||
) | ||
} | ||
run_app() | ||
test_check("MetaShARK") | ||
library(testthat) | ||
library(MetaShARK) | ||
test_check("MetaShARK") | ||
run_app() | ||
MetaShARK::runMetashark | ||
source('~/Softwares/MetaShARK/R/run_app.R') | ||
library(MetaShARK) | ||
#' Run the Shiny Application | ||
#' | ||
#' @export | ||
#' @importFrom shiny shinyApp | ||
#' @importFrom golem with_golem_options | ||
runMetashark <- function(...) { | ||
with_golem_options( | ||
app = shinyApp(ui = app_ui, server = app_server), | ||
golem_opts = list(...) | ||
) | ||
} | ||
library(MetaShARK) | ||
library(MetaShARK) | ||
MetaShARK::run_app() | ||
getwd() | ||
build(,) | ||
build | ||
build() | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
document_and_reload() | ||
runMetashark() | ||
runMetashark() | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
runMetashark() | ||
?golem_add_external_resources | ||
?golem::golem_add_external_resources | ||
golem::golem_add_external_resources | ||
library(golem) | ||
golem::golem_add_external_resources | ||
getwd() | ||
document_and_reload | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
runMetashark() | ||
?runMetashark | ||
document_and_reload() | ||
?runMetashark | ||
document_and_reload() | ||
library(golem) | ||
document_and_reload() | ||
runMetashark() | ||
document_and_reload() | ||
data() | ||
??build | ||
getwd() | ||
document_and_reload | ||
load_all() | ||
??load_all | ||
devtools::load_all() | ||
devtools::load_all() | ||
test <- readRDS("resources/backboneGuideline.RData") | ||
getwd() | ||
backboneGuideline <- test | ||
usethis::use_data(backboneGuideline) | ||
docGuideline <- readRDS("resources/docGuideline.RData"); usethis::use_data(docGuideline) | ||
systemGuideline <- readRDS("resources/systemGuideline.RData"); usethis::use_data(systemGuideline) | ||
rm(list = ls()) | ||
devtools::load_all() | ||
runMetashark() | ||
devtools::load_all() | ||
runMetashark() | ||
devtools::load_all() | ||
runMetashark() | ||
devtools::load_all() | ||
runMetashark() |
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 @@ | ||
inst/doc | ||
.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Package: MetaShARK | ||
Title: metashark | ||
Version: 0.0.0.9000 | ||
Authors@R: person('Elie', 'ARNAUD', email = '[email protected]', role = c('cre', 'aut')) | ||
Description: MetaShARK is a Shiny application allowing its | ||
user to fill metadata for a given ecological | ||
dataset of his owns. The data description relies | ||
on Ecological Metadata Language (EML). | ||
License: What license is it under? | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Imports: | ||
shiny, | ||
golem, | ||
processx, | ||
attempt, | ||
DT, | ||
glue, | ||
htmltools | ||
RoxygenNote: 6.1.1 | ||
URL: https://github.com/earnaud/MetaShARK.git | ||
BugReports: https://github.com/earnaud/MetaShARK.git/issues | ||
Suggests: | ||
testthat, | ||
knitr, | ||
rmarkdown | ||
VignetteBuilder: knitr |
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,17 @@ | ||
Version: 1.0 | ||
|
||
RestoreWorkspace: Default | ||
SaveWorkspace: Default | ||
AlwaysSaveHistory: Default | ||
|
||
EnableCodeIndexing: Yes | ||
UseSpacesForTab: Yes | ||
NumSpacesForTab: 2 | ||
Encoding: UTF-8 | ||
|
||
RnwWeave: Sweave | ||
LaTeX: pdfLaTeX | ||
|
||
BuildType: Package | ||
PackageUseDevtools: Yes | ||
PackageInstallArgs: --no-multiarch --with-keep.source |
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,13 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
import(shiny) | ||
import(shinydashboard) | ||
import(shinyjs) | ||
importFrom(glue,glue) | ||
importFrom(golem,with_golem_options) | ||
importFrom(htmltools,HTML) | ||
importFrom(htmltools,tagAppendAttributes) | ||
importFrom(htmltools,tagList) | ||
importFrom(htmltools,tags) | ||
importFrom(shiny,column) | ||
importFrom(shiny,shinyApp) |
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 @@ | ||
#' @import shiny | ||
.app_server <- function(input, output,session) { | ||
## DEV: do things by clicking a button | ||
observeEvent(input$check,{ | ||
browser() | ||
}) | ||
|
||
## modules called ---- | ||
# welcome | ||
|
||
# fill | ||
# doc | ||
# about | ||
} |
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,75 @@ | ||
#' @import shiny shinyjs shinydashboard | ||
.app_ui <- function() { | ||
global <- .globalScript() | ||
print(global$a) | ||
|
||
# prepare variable | ||
menuWidth = "250px" | ||
|
||
# action | ||
tagList( | ||
# Leave this function for adding external resources | ||
.golem_add_external_resources(), | ||
# List the first level UI elements here | ||
dashboardPage( | ||
title = "MetaShARK", | ||
dashboardHeader( | ||
title = span(imageOutput("metashark-logo", inline = TRUE), "MetaShARK"), | ||
titleWidth = menuWidth | ||
), | ||
## Menus ---- | ||
dashboardSidebar( | ||
useShinyjs(), | ||
sidebarMenu( | ||
menuItem("Welcome", tabName = "welcome", | ||
icon = icon("home")), | ||
menuItem("Fill in EML", tabName = "fill", | ||
icon = icon("file-import")), | ||
menuItem("EML Documentation", tabName = "documentation", | ||
icon = icon("glasses")), | ||
menuItem("About MetaShARK", tabName = "about", | ||
icon = icon("beer")) | ||
,actionButton("check","Dev Check") | ||
), | ||
width = menuWidth | ||
), # end sidebar | ||
## Content ---- | ||
dashboardBody( | ||
tabItems( | ||
tabItem(tabName = "welcome", | ||
# welcomeUI(IM.welcome[1], IM = IM.welcome)), | ||
fluidPage(1)), | ||
tabItem(tabName = "fill", | ||
# fillUI(IM.fill[1], IM = IM.fill)), | ||
fluidPage(2)), | ||
tabItem(tabName = "documentation", | ||
# docUI(IM.doc[1], IM = IM.doc)), | ||
fluidPage(3)), | ||
tabItem(tabName = "about", | ||
# aboutUI(IM.about[1], IM = IM.about)) | ||
fluidPage(4)) | ||
) | ||
) # end body | ||
|
||
) # end dashboard | ||
|
||
) # end taglist | ||
|
||
} | ||
|
||
#' @import shiny | ||
.golem_add_external_resources <- function(){ | ||
|
||
addResourcePath( | ||
'www', system.file('app/www', package = 'MetaShARK') | ||
) | ||
|
||
tags$head( | ||
golem::activate_js(), | ||
golem::favicon() | ||
# Add here all the external resources | ||
# If you have a custom.css in the inst/app/www | ||
# Or for example, you can add shinyalert::useShinyalert() here | ||
#tags$link(rel="stylesheet", type="text/css", href="www/custom.css") | ||
) | ||
} |
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,32 @@ | ||
# Inverted versions of in, is.null and is.na | ||
`%not_in%` <- Negate(`%in%`) | ||
|
||
not_null <- Negate(is.null) | ||
|
||
not_na <- Negate(is.na) | ||
|
||
# Removes the null from a vector | ||
drop_nulls <- function(x){ | ||
x[!sapply(x, is.null)] | ||
} | ||
|
||
# If x is null, return y, otherwise return x | ||
"%||%" <- function(x, y){ | ||
if (is.null(x)) { | ||
y | ||
} else { | ||
x | ||
} | ||
} | ||
# If x is NA, return y, otherwise return x | ||
"%|NA|%" <- function(x, y){ | ||
if (is.na(x)) { | ||
y | ||
} else { | ||
x | ||
} | ||
} | ||
|
||
# typing reactiveValues is too long | ||
rv <- shiny::reactiveValues | ||
rvtl <- shiny::reactiveValuesToList |
Oops, something went wrong.