Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed data loading #6

Merged
merged 7 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ app_server <- function(input, output, session) {
,plot3_efs = r$preds3_efs$plot

,patprofile = r$pdatc$patdat_clean
,dat_fmtfun = dat_fmtfun
)
rmarkdown::render("R/report.Rmd"
, output_file = file
Expand Down
13 changes: 6 additions & 7 deletions R/app_ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ waiter::waiter_set_theme(html = waiter::spin_3()
options(mc.cores = 8)

# load data:
zcta_hhinc <- readRDS(file = "data/zcta_hhinc.RDS")
patdat_default <- readRDS(file = "data/patdat_default.RDS")
xtest_names <- readRDS(file = "data/xtest_vnames.RDS")
dat_fmtfun <- readRDS(file = "data/dat_fmtfun.RDS")

nft_os <- readRDS(file = "data/deadcounter.rds")
nft_efs <- readRDS(file = "data/efscounter.rds")
# zcta_hhinc <- readRDS(file = "data/zcta_hhinc.RDS")
# patdat_default <- readRDS(file = "data/patdat_default.RDS")
# xtest_names <- readRDS(file = "data/xtest_vnames.RDS")
# dat_fmtfun <- readRDS(file = "data/dat_fmtfun.RDS")
# nft_os <- readRDS(file = "data/deadcounter.rds")
# nft_efs <- readRDS(file = "data/efscounter.rds")

#' The application User-Interface
#'
Expand Down
64 changes: 0 additions & 64 deletions R/data_document.R

This file was deleted.

4 changes: 3 additions & 1 deletion R/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ params:
ptbl3_efs: NA
plot3_efs: NA
patprofile: NA
dat_fmtfun: NA
---

# 1-Year Survival Estimates:
Expand Down Expand Up @@ -167,7 +168,8 @@ vnames <- c("age"

```{r echo = FALSE}

dat_fmtfun <- readRDS("../data/dat_fmtfun.RDS")
# dat_fmtfun <- readRDS("../data/dat_fmtfun.RDS")
dat_fmtfun <- params$dat_fmtfun

patdat <- dat_fmtfun(params$patprofile)

Expand Down
10 changes: 6 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "README for nmdp.asom"
author: "Lisa Rein"
date: "2024-08-23"
date: "2024-10-15"
output: html_document
---

Expand All @@ -14,16 +14,16 @@ setwd(mydir)

list.files(mydir)

# make sure that model objects deadcounter.rds and efscounter.rds are saved in data folder:
list.files(paste0(mydir, "/data"))
# internal app data, sysdata.rda, should be saved in R subfolder:
list.files(paste0(mydir, "/R"))

```


```{r eval = FALSE}

# To run the app:
# Note the model objects are large and the initial load could take a long time:
# Note the internal app data (includes model objects) is large and the initial load could take a while:
library(shiny)
shiny::runApp()

Expand All @@ -36,6 +36,8 @@ shiny::runApp()

# Dependent packages should automatically be installed/loaded but just in case,
# app dependencies (also noted in NAMESPACE):

# export(run_app)
# import(bslib)
# import(flextable)
# import(ggplot2)
Expand Down
34 changes: 24 additions & 10 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<meta name="author" content="Lisa Rein" />

<meta name="date" content="2024-08-23" />
<meta name="date" content="2024-10-15" />

<title>README for nmdp.asom</title>

Expand Down Expand Up @@ -352,7 +352,7 @@

<h1 class="title toc-ignore">README for nmdp.asom</h1>
<h4 class="author">Lisa Rein</h4>
<h4 class="date">2024-08-23</h4>
<h4 class="date">2024-10-15</h4>

</div>

Expand All @@ -363,21 +363,35 @@ <h4 class="date">2024-08-23</h4>
setwd(mydir)

list.files(mydir)</code></pre>
<pre><code>## [1] &quot;app.R&quot; &quot;data&quot; &quot;DESCRIPTION&quot; &quot;dev&quot;
## [5] &quot;inst&quot; &quot;man&quot; &quot;NAMESPACE&quot; &quot;nmdp.asom.Rproj&quot;
## [9] &quot;R&quot; &quot;README.html&quot; &quot;README.Rmd&quot;</code></pre>
<pre class="r"><code># make sure that model objects deadcounter.rds and efscounter.rds are saved in data folder:
list.files(paste0(mydir, &quot;/data&quot;))</code></pre>
<pre><code>## [1] &quot;dat_fmtfun.RDS&quot; &quot;deadcounter.rds&quot; &quot;efscounter.rds&quot;
## [4] &quot;patdat_default.RDS&quot; &quot;xtest_vnames.RDS&quot; &quot;zcta_hhinc.RDS&quot;</code></pre>
<pre><code>## [1] &quot;app.R&quot; &quot;DESCRIPTION&quot; &quot;dev&quot; &quot;inst&quot;
## [5] &quot;man&quot; &quot;NAMESPACE&quot; &quot;nmdp.asom.Rproj&quot; &quot;R&quot;
## [9] &quot;README.html&quot; &quot;README.Rmd&quot;</code></pre>
<pre class="r"><code># internal app data, sysdata.rda, should be saved in R subfolder:
list.files(paste0(mydir, &quot;/R&quot;))</code></pre>
<pre><code>## [1] &quot;_disable_autoload.R&quot; &quot;app_config.R&quot;
## [3] &quot;app_server.R&quot; &quot;app_ui.R&quot;
## [5] &quot;golem_utils_server.R&quot; &quot;golem_utils_ui.R&quot;
## [7] &quot;mod_assemble_patprofile.R&quot; &quot;mod_clean_patprofile.R&quot;
## [9] &quot;mod_enter_demo.R&quot; &quot;mod_enter_disease.R&quot;
## [11] &quot;mod_enter_disease_all.R&quot; &quot;mod_enter_disease_aml.R&quot;
## [13] &quot;mod_enter_disease_cll.R&quot; &quot;mod_enter_disease_cml.R&quot;
## [15] &quot;mod_enter_disease_hd.R&quot; &quot;mod_enter_disease_mds.R&quot;
## [17] &quot;mod_enter_disease_mm.R&quot; &quot;mod_enter_disease_nhl.R&quot;
## [19] &quot;mod_enter_donor.R&quot; &quot;mod_enter_transplant.R&quot;
## [21] &quot;mod_predict_efs.R&quot; &quot;mod_predict_os.R&quot;
## [23] &quot;mod_save_patprofile.R&quot; &quot;mod_upload_patprofile.R&quot;
## [25] &quot;report.Rmd&quot; &quot;run_app.R&quot;
## [27] &quot;sysdata.rda&quot;</code></pre>
<pre class="r"><code># To run the app:
# Note the model objects are large and the initial load could take a long time:
# Note the internal app data (includes model objects) is large and the initial load could take a while:
library(shiny)
shiny::runApp()

# you should see a message in the console if the app is successfully loading: &#39;Loading nmdp.asom&#39;</code></pre>
<pre class="r"><code># Dependent packages should automatically be installed/loaded but just in case,
# app dependencies (also noted in NAMESPACE):

# export(run_app)
# import(bslib)
# import(flextable)
# import(ggplot2)
Expand Down
Binary file removed data/dat_fmtfun.RDS
Binary file not shown.
Binary file removed data/patdat_default.RDS
Binary file not shown.
Binary file removed data/xtest_vnames.RDS
Binary file not shown.
Binary file removed data/zcta_hhinc.RDS
Binary file not shown.
13 changes: 0 additions & 13 deletions man/dat_fmtfun.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/deadcounter.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/efscounter.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/patdat_default.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/xtest_vnames.Rd

This file was deleted.

13 changes: 0 additions & 13 deletions man/zcta_hhinc.Rd

This file was deleted.

46 changes: 23 additions & 23 deletions nmdp.asom.Rproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
Version: 1.0
RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No
EnableCodeIndexing: No
UseSpacesForTab: Yes
NumSpacesForTab: 4
Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX
AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix
BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
QuitChildProcessesOnExit: Yes
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: No

EnableCodeIndexing: No
UseSpacesForTab: Yes
NumSpacesForTab: 4
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes
LineEndingConversion: Posix

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source

QuitChildProcessesOnExit: Yes