Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Flavjack/GerminaR
Browse files Browse the repository at this point in the history
  • Loading branch information
FannyDolores committed Aug 16, 2020
2 parents b83a99e + 4f5445d commit 7456d06
Show file tree
Hide file tree
Showing 23 changed files with 194 additions and 32 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Include examples in the functions
- Update vignettes
- Update functions to tidyverse.
- Conditional data viewer in the app.

## Bug fixes

Expand Down
4 changes: 2 additions & 2 deletions R/fplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ fplot <- function(data

# -------------------------------------------------------------------------

min_value <- min(plot_dt$min)
max_value <- max(plot_dt$max)
min_value <- min(plot_dt$min, na.rm = TRUE)
max_value <- max(plot_dt$max, na.rm = TRUE)

if ( is.null(brakes) ) { brakes <- abs(round(max_value*1.2, 1))/5 }

Expand Down
17 changes: 8 additions & 9 deletions R/ger_intime.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
#'
#' library(GerminaR)
#' data <- prosopis
#' grt <- ger_intime(Factor = "nacl"
#' grt <- ger_intime(Factor = "temp"
#' , SeedN = "seeds"
#' , evalName = "D"
#' , method = "relative"
#' , method = "rel"
#' , data = data
#' )
#' )
#' head(grt, 10)
#'
#' fplot(data = grt
#' , type = "line"
#' , x = "evaluation"
#' , y = "mean"
#' , groups = "nacl"
#' , groups = "temp"
#' , sig = NULL
#' )

Expand Down Expand Up @@ -74,22 +74,21 @@ ger_intime <- function(Factor
pivot_longer(names(evd)
, names_to = "evaluation"
, values_to = "germination"
, values_drop_na = TRUE
) %>%
group_by(.data[[Factor]], evaluation) %>%
summarise(mean = mean(germination)
summarise(mean = mean(germination, rm.na = TRUE)
, r = dplyr::n()
, std = sd(germination)
, min = min(germination)
, max = max(germination)
) %>%
ungroup() %>%
mutate(ste = std/sqrt(r)) %>%
mutate(ste = std/sqrt(r)) %>%
mutate(evaluation = gsub("\\D", "", evaluation)) %>%
mutate(across(evaluation, ~ as.numeric(.))) %>%
arrange(evaluation) %>%
mutate(across( {{Factor}}, ~ as.factor(.))) %>%
mutate(across(where(is.numeric), ~replace(., is.na(.), 0))) %>%
mutate(across(where(is.numeric), ~replace(., is.nan(.), 0)))
mutate(across( {{Factor}}, ~ as.factor(.)))

# result ------------------------------------------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ account: flavjack
server: shinyapps.io
hostUrl: https://api.shinyapps.io/v1
appId: 136814
bundleId: 3491410
bundleId: 3501356
url: https://flavjack.shinyapps.io/germinaquant/
when: 1596923423.23757
when: 1597144329.23554
asMultiple: FALSE
asStatic: FALSE
ignoredFiles: setup.R
66 changes: 59 additions & 7 deletions inst/GerminaQuant/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ library(shinydashboard)
library(shinyWidgets)
library(gsheet)
library(readxl)
library(DT)
library(ggpubr)
library(DT)

# app ---------------------------------------------------------------------
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -60,16 +60,68 @@ shinyServer(function(input, output) {

}, ignoreNULL = FALSE)


# -------------------------------------------------------------------------

output$fbook <- renderUI({
# data viewer -------------------------------------------------------------
# -------------------------------------------------------------------------

output$fb_excel <- DT::renderDataTable(server = FALSE, {

DT::datatable(data = data_fb(),
filter = 'top',
extensions = c('Buttons', 'Scroller'),
rownames = FALSE,

options = list(

searchHighlight = TRUE,
searching = TRUE,

dom = 'Bfrtip',
buttons = list(
'copy',
list(extend = 'csv', filename = input$stat_rsp),
list(extend = 'excel', filename = input$stat_rsp)
),

autoWidth = TRUE,
columnDefs = list(list(className = 'dt-center', targets ="_all")),
deferRender=TRUE,
scrollY = 400,
scrollX = TRUE,
scroller = TRUE,

initComplete = DT::JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#000', 'color': '#fff'});",
"}")
))
})

gss <- tags$iframe(src = input$import_gsheet,
style="height:450px; width:100%; scrolling=no")
# -------------------------------------------------------------------------

print(gss)
output$fb_gsheets <- renderUI({

tags$iframe(src = input$import_gsheet,
style="height:450px; width:100%; scrolling=no")

})

output$data_viewer <- renderUI({

if ( !is.null(input$import_excel) & input$import_gsheet != "" ) {

DT::dataTableOutput("fb_excel")

} else if ( input$import_gsheet != "" ) {

htmlOutput("fb_gsheets")

} else if ( !is.null(input$import_excel) ) {

DT::dataTableOutput("fb_excel")

} else { "Insert a Google spreadsheet URL or xlsx file" }

})

# filter ------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion inst/GerminaQuant/setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cran <- c("devtools"

git <- c(
"Flavjack/GerminaR"
)
)

installed <- c(cran, sub(".*/", "", git)) %in% rownames(installed.packages())

Expand All @@ -41,3 +41,5 @@ rm(cran, git, installed)
# open https://shiny.rstudio.com/tutorial/written-tutorial/lesson3/

# http://r-pkgs.had.co.nz/release.html

# open https://realfavicongenerator.net/
14 changes: 7 additions & 7 deletions inst/GerminaQuant/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ library(shinydashboard)
library(shinyWidgets)
library(gsheet)
library(readxl)
library(DT)
library(ggpubr)
library(DT)

# app ---------------------------------------------------------------------
# -------------------------------------------------------------------------
Expand Down Expand Up @@ -50,14 +50,14 @@ shinyUI(dashboardPage(skin = "green",
),

tags$head(includeHTML(("www/analytics.html"))),
tags$head(tags$link(rel="shortcut icon", href="https://flavjack.shinyapps.io/germinaquant/_w_6f298bc3/icon.png")),
tags$head(tags$link(rel="shortcut icon", href="https://raw.githubusercontent.com/Flavjack/GerminaR/master/inst/GerminaQuant/www/favicon/android-chrome-256x256.png")),

meta() %>%
meta_social(
title = "GerminaR",
description = "Indices and Graphics for Assess Seed Germination Process",
url = "https://flavjack.shinyapps.io/germinaquant/",
image = "https://flavjack.shinyapps.io/germinaquant/_w_4854280b/icon.png",
image = "https://raw.githubusercontent.com/Flavjack/GerminaR/master/inst/GerminaQuant/www/favicon/android-chrome-256x256.png",
image_alt = "GerminaR"
),

Expand Down Expand Up @@ -243,7 +243,7 @@ shinyUI(dashboardPage(skin = "green",
solidHeader = T,
width = 10,

htmlOutput("fbook")
htmlOutput("data_viewer")

),

Expand Down Expand Up @@ -614,7 +614,7 @@ shinyUI(dashboardPage(skin = "green",
column(width = 12,

numericInput('plot_width', 'Width (cm)',
value = 15,
value = 20,
min = 5,
step = 5)

Expand Down Expand Up @@ -799,7 +799,7 @@ tabItem(tabName = "germint",
column(width = 12,

numericInput('intime_width', 'Width (cm)',
value = 15,
value = 20,
min = 5,
step = 5)
),
Expand Down
File renamed without changes
Binary file added inst/GerminaQuant/www/GerminaR2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed inst/GerminaQuant/www/favicon.ico
Binary file not shown.
Binary file added inst/GerminaQuant/www/favicon.zip
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions inst/GerminaQuant/www/favicon/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added inst/GerminaQuant/www/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/GerminaQuant/www/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added inst/GerminaQuant/www/favicon/favicon.ico
Binary file not shown.
7 changes: 7 additions & 0 deletions inst/GerminaQuant/www/favicon/icons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
<link rel="manifest" href="/favicon/site.webmanifest">
<link rel="mask-icon" href="/favicon/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#2d89ef">
<meta name="theme-color" content="#ffffff">
Binary file added inst/GerminaQuant/www/favicon/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 73 additions & 0 deletions inst/GerminaQuant/www/favicon/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions inst/GerminaQuant/www/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "GerminaQuant",
"short_name": "GerminaQuant",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
8 changes: 4 additions & 4 deletions man/ger_intime.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7456d06

Please sign in to comment.