Skip to content

Commit

Permalink
fbcheck-fbApp test 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
CIP-RIU committed May 29, 2018
1 parent b264111 commit 1ac79af
Show file tree
Hide file tree
Showing 51 changed files with 59 additions and 3 deletions.
Empty file modified .Rbuildignore
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified DESCRIPTION
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified NAMESPACE
100644 → 100755
Empty file.
Empty file modified R/data_pvs.R
100644 → 100755
Empty file.
Empty file modified R/fbcheck_server.R
100644 → 100755
Empty file.
56 changes: 55 additions & 1 deletion R/fbcheck_server_sbase.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,18 @@ fbcheck_server_sbase <- function(input, output, session, values) {
file_fbapp <- input$file_fbapp_sbase
if (is.null(file_fbapp)) return(NULL)
dt <- readr::read_csv(file_fbapp$datapath)

if(!is.element("plot_name", names(dt))){
shinysky::showshinyalert(session, "alert_fbapp_warning_sbase", paste("ERROR: The file imported does not has 'plot_name' header."), styleclass = "danger")
} else if(nrow(dt)==1){
shinysky::showshinyalert(session, "alert_fbapp_warning_sbase", paste("ERROR: Your data file has only one row of data. Please upload the right one. "), styleclass = "danger")
} else {
hot_bdata <- fbapp2hidap(dt)
}

#dt <- readr::read_csv(file ="D:\\HIDAP_DOCUMENTATION_AND_EXAMPLES\\HIDAP-SweetPotatoBase\\FieldBookApp\\formato para subir a la base de datos\\fbapp_trial1_sbase_bryanEllerbrock.csv")
# Data wrangling ----------------------------------------------------------
hot_bdata <- fbapp2hidap(dt)

#}

hot_bdata
Expand Down Expand Up @@ -101,6 +110,21 @@ fbcheck_server_sbase <- function(input, output, session, values) {
)
}
})
#### temp



# output$tbl <- renderTable({
# rv$data
# })



### end temp





#Return the type of crop in Minimal sheet
hot_crop_sbase <- reactive({
Expand Down Expand Up @@ -142,13 +166,18 @@ fbcheck_server_sbase <- function(input, output, session, values) {
DF = values[["hot_btable_fbapp_sbase"]]
}



# if(input$calculate_sbase>0){
#
# DF <- values[["hot_btable_fbapp_sbase"]]
# DF <- rhandsontable_update(DF)
# #DF <- temp
# }

print("print DF")
print(DF)
print("end d")

if(!is.null(DF)){

Expand Down Expand Up @@ -234,13 +263,38 @@ fbcheck_server_sbase <- function(input, output, session, values) {
content = function(con) {
path <- fbglobal::get_base_dir()
#print(path)
shiny::withProgress(message = 'Downloading file', value = 0, {

incProgress(1/6, detail = paste("Reading HIDAP data..."))
path <- file.path(path,"hot_fieldbook_sbase.rds")


#print(path)
DF <- readRDS(path)

incProgress(2/6, detail = paste("Formatting hidap file..."))

fb<- hidap2fbApp(fieldbook = DF)

incProgress(3/6, detail = paste("Downloading FieldBookApp-SPBase file..."))

incProgress(4/6, detail = paste("Refreshing HIDAP..."))

Sys.sleep(3)
incProgress(5/6, detail = paste("Refreshing HIDAP..."))

write.csv(fb, con,row.names = FALSE)

incProgress(6/6, detail = paste("Refreshing HIDAP..."))
Sys.sleep(5)
shinyjs::js$downloadData()
})


}
)


}


Empty file modified R/fbcheck_ui.R
100644 → 100755
Empty file.
6 changes: 4 additions & 2 deletions R/fbcheck_ui_sbase.R
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na
#begin data_processing tabItem
shinydashboard::tabItem(tabName = name,
h2(title),
shinyjs::useShinyjs(),
shinyjs::extendShinyjs(text = "shinyjs.downloadData = function() { location.reload(); }"),

# shinyWidgets::awesomeRadio(inputId = "fbdesign_dsource_sbase",
# label = "Select data source", choices = c("HIDAP",
Expand Down Expand Up @@ -47,7 +49,7 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na

shiny::fileInput(inputId = "file_fbapp_sbase", label = "Choose CSV File", multiple = FALSE,
accept = c("text/csv","text/comma-separated-values,text/plain", ".csv")),

#actionButton('reset', 'Reset Input'),

HTML('<div style="float: right; margin: 0 5px 5px 10px;">'),
shiny::downloadLink('downloadData', 'Download'),
Expand Down Expand Up @@ -75,7 +77,7 @@ fbcheck_ui_sbase <- function(type="tab", title="Data Quality and Processing", na
# HTML('<div style="float: right; margin: 0 5px 5px 10px;">'),
# shiny::actionLink('exportButton', 'Download data'),
# HTML('</div>'),
shinysky::shinyalert("alert_fb_warning_sbase", FALSE, auto.close.after = 4),
shinysky::shinyalert("alert_fbapp_warning_sbase", FALSE, auto.close.after = 4),

# conditionalPanel(
# condition = "input.fbdesign_dsource_sbase == 'HIDAP'",
Expand Down
Empty file modified R/trait_function.R
100644 → 100755
Empty file.
Empty file modified R/utils.R
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified data/selcriteria.rda
100644 → 100755
Empty file.
Empty file modified fbcheck.Rproj
100644 → 100755
Empty file.
Empty file modified inst/app/app.R
100644 → 100755
Empty file.
Empty file modified inst/app_fbcheck/PTYL200211_CHIARA.xlsx
100644 → 100755
Empty file.
Empty file modified inst/app_fbcheck/app.R
100644 → 100755
Empty file.
Empty file modified inst/app_fbcheck/table_dictionary_potato.rda
100644 → 100755
Empty file.
Empty file modified inst/app_fbcheck/table_dictionary_sweetpotato.rda
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file modified man/fbapp2hidap.Rd
100644 → 100755
Empty file.
Empty file modified man/fbcheck_server.Rd
100644 → 100755
Empty file.
Empty file modified man/fbcheck_server_sbase.Rd
100644 → 100755
Empty file.
Empty file modified man/fbcheck_ui.Rd
100644 → 100755
Empty file.
Empty file modified man/fbcheck_ui_sbase.Rd
100644 → 100755
Empty file.
Empty file modified man/form_checker.Rd
100644 → 100755
Empty file.
Empty file modified man/form_parameters.Rd
100644 → 100755
Empty file.
Empty file modified man/get.fb.param.Rd
100644 → 100755
Empty file.
Empty file modified man/get_pvs_param.Rd
100644 → 100755
Empty file.
Empty file modified man/hidap2fbApp.Rd
100644 → 100755
Empty file.
Empty file modified man/out_form_table.Rd
100644 → 100755
Empty file.
Empty file modified man/rhandsontable_update.Rd
100644 → 100755
Empty file.
Empty file modified man/scale_trait.Rd
100644 → 100755
Empty file.
Empty file modified man/selcriteria.Rd
100644 → 100755
Empty file.
Empty file modified man/split_tidy_form.Rd
100644 → 100755
Empty file.
Empty file modified man/trait_type.Rd
100644 → 100755
Empty file.
Empty file modified man/x_form.Rd
100644 → 100755
Empty file.
Empty file modified man/x_values.Rd
100644 → 100755
Empty file.
Empty file modified tests/testthat.R
100644 → 100755
Empty file.
Empty file modified tests/testthat/excel/F7_OneEmptyForm_QUILCAS.xlsx
100644 → 100755
Empty file.
Empty file modified tests/testthat/excel/PTPVS032013_Jumla_exp3.xlsx
100644 → 100755
Empty file.
Empty file modified tests/testthat/excel/PTPVS032013_Jumla_exp3_NA_character.xlsx
100644 → 100755
Empty file.
Empty file modified tests/testthat/excel/PTPVS032013_Jumla_exp3_VACIO.xlsx
100644 → 100755
Empty file.
Empty file modified tests/testthat/excel/PTPVS112016_CANAYPATA_exp1.xlsx
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified tests/testthat/excel/missingval_form18.xlsx
100644 → 100755
Empty file.
Empty file modified tests/testthat/test_organoleptic.R
100644 → 100755
Empty file.

0 comments on commit 1ac79af

Please sign in to comment.