Codes for explaining the software and the packages that are used in the analysis^[See childRmd/_23footer.Rmd file for other codes]

Save Final Data {.appendix}

projectName <- list.files(path = here::here(), pattern = "Rproj")
projectName <- gsub(pattern = ".Rproj", replacement = "", x = projectName)

analysisDate <- as.character(Sys.Date())

imageName <- paste0(projectName, analysisDate, ".RData")

save.image(file = here::here("data", imageName))

rdsName <- paste0(projectName, analysisDate, ".rds")

readr::write_rds(x = mydata, path = here::here("data", rdsName))

saveRDS(object = mydata, file = here::here("data", rdsName))

excelName <- paste0(projectName, analysisDate, ".xlsx")

rio::export(
  x = mydata,
  file = here::here("data", excelName),
  format = "xlsx"
)

excelName2 <- paste0(projectName, "-2-", analysisDate, ".xlsx")

si <- sessioninfo::session_info()
writexl::write_xlsx(x = 
  list(
    maindata = mydata,
    meta_platform = (as.data.frame(unclass(si$platform))),
    meta_packages = si$packages
  ),
  path = here::here("data", excelName2)
)








# writexl::write_xlsx(mydata, here::here("data", excelName))

print(glue::glue(
    "saved data after analysis to ",
    rownames(file.info(here::here("data", excelName))),
    " : ",
    as.character(
        file.info(here::here("data", excelName))$ctime
    )
    )
)
mydata %>% 
  downloadthis::download_this(
    output_name = excelName,
    output_extension = ".csv",
    button_label = "Download data as csv",
    button_type = "default"
  )

mydata %>% 
  downloadthis::download_this(
    output_name = excelName,
    output_extension = ".xlsx",
    button_label = "Download data as xlsx",
    button_type = "primary"
  )
# pacman::p_load(here, lubridate, glue)
# here::here("data", glue("{today()}_trends.csv"))

\pagebreak

Final Data Summary {.appendix}

# use summarytools to generate final data summary
# summarytools::view(summarytools::dfSummary(x = mydata
#                                            , style = "markdown"))
# mydata %>% select(
#     -c(
#         rapor_yil,
#         rapor_no,
#         protokol_no,
#         istek_tarihi,
#         nux_yada_met_varsa_tarihi,
#         son_hastane_vizit_tarihi,
#         Outcome
#     )
# ) -> finalSummary
# 
# summarytools::view(summarytools::dfSummary(x = finalSummary
#                                            , style = "markdown"))

\pagebreak

Software and Libraries Used {.appendix}

Why and how to cite software and packages?^[Smith AM, Katz DS, Niemeyer KE, FORCE11 Software Citation Working Group. (2016) Software Citation Principles. PeerJ Computer Science 2:e86. DOI: 10.7717/peerj-cs.86 https://www.force11.org/software-citation-principles]

citation()

The jamovi project (2019). jamovi. (Version 0.9) [Computer Software]. Retrieved from https://www.jamovi.org.
R Core Team (2018). R: A Language and envionment for statistical computing. [Computer software]. Retrieved from https://cran.r-project.org/.
Fox, J., & Weisberg, S. (2018). car: Companion to Applied Regression. [R package]. Retrieved from https://cran.r-project.org/package=car. Wickham et al., (2019). Welcome to the tidyverse. Journal of Open Source Software, 4(43), 1686, https://doi.org/10.21105/joss.01686 Data processing was carried out with R (R Core Team, 2019) and the easystats ecosystem (Lüdecke, Waggoner, & Makowski, 2019; Makowski, Ben-Shachar, & Lüdecke, 2019)

report::cite_packages(session = sessionInfo())
report::show_packages(session = sessionInfo()) %>% 
    kableExtra::kable()
# citation("tidyverse")
citation("readxl")
citation("janitor")
# citation("report")
citation("finalfit")
# citation("ggstatsplot")
if(!dir.exists(here::here("bib"))) {dir.create(here::here("bib"))}

knitr::write_bib(x = c(.packages(), "knitr", "shiny"),
                 file = here::here("bib", "packages.bib")
)

\pagebreak

Session Info {.appendix}

sessionInfo()
sessioninfo::os_name()

sessioninfo::package_info()

sessioninfo::platform_info()

sessioninfo::session_info()

\pagebreak


Loaded packages {.appendix}

pacman::p_loaded(all = TRUE)
search()
library()
installed.packages()[1:5, c("Package", "Version")]
installed.packages()

Reproducibility

Reproducibility receipt

# https://twitter.com/MilesMcBain/status/1263272935197782016

## datetime
Sys.time()

## repository
git2r::repository()

## sessionInfo
sessionInfo()


\pagebreak

Notes {.appendix}

Last update on $ r as.character(Sys.time()) $

Serdar Balci, MD, Pathologist
serdarbalci@serdarbalci.com
https://rpubs.com/sbalci/CV
https://github.com/sbalci
https://sbalci.github.io/
Patoloji Notları
ParaPathology
https://twitter.com/serdarbalci


\pagebreak

Code Appendix

Use following chunk options to include all codes below the report.

{r, echo=TRUE, eval=FALSE, ref.label=knitr::all_labels()}



sbalci/histopathology-template documentation built on June 29, 2023, 5:52 a.m.