Skip to content

Commit

Permalink
add quote
Browse files Browse the repository at this point in the history
  • Loading branch information
slphyx committed May 14, 2019
1 parent 7248961 commit cc903be
Show file tree
Hide file tree
Showing 3 changed files with 600 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/TEMPLATE.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ shinyUI(
# Sidebar with sliders
sidebarPanel(
CONTROLS
#add the quote
, br(), hr(),
tags$p("QUOTE")
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("graphs")
Expand Down
14 changes: 14 additions & 0 deletions R/genfiles.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ GenShinyFiles <- function(txt,path){

newpars <- newpars %>% AddParVar(parvar='parms') %>% is.par.alone

#random quote
rq <- RQ()

# add CONTROLS
ui_txt <- ui %>% gsub(pattern = 'CONTROLS', replacement = ctrltxt)

# add quote
ui_txt <- ui_txt %>% gsub(pattern = 'QUOTE', replacement = rq)

# add ode function
sv_txt <- sv %>% gsub(pattern = 'ODEFUNC', replacement = starttxt)

Expand Down Expand Up @@ -58,3 +63,12 @@ GenShinyFiles <- function(txt,path){
}


##random quote
RQ <- function(){
raw <- paste0(system.file(package='Kung'),"/quotes/ada.dat") %>% readLines
rn<-sample.int(length(raw),1)
return(raw[rn])
}



Loading

0 comments on commit cc903be

Please sign in to comment.