Skip to content

Commit

Permalink
Import project
Browse files Browse the repository at this point in the history
  • Loading branch information
ghurault committed Feb 11, 2024
1 parent 53d6b7a commit 6a4b2da
Show file tree
Hide file tree
Showing 55 changed files with 7,582 additions and 0 deletions.
1 change: 1 addition & 0 deletions .Rprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
source("renv/activate.R")
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# Custom
models/*.rds
results/*
results*
docs/*
*.html
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Take inspiration from
# https://github.com/jrnold/docker-stan/blob/master/rstan/Dockerfile

FROM rocker/tidyverse:4.1.3

RUN apt-get update \
&& apt-get install -y --no-install-recommends apt-utils ed libnlopt-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/

# Global site-wide config -- neeeded for building packages
RUN mkdir -p $HOME/.R/ \
&& echo "CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -ffat-lto-objects -Wno-unused-local-typedefs \n" >> $HOME/.R/Makevars \
&& echo "CXXFLAGS=-O3 -mtune=native -march=native -Wno-unused-variable -Wno-unused-function -flto -ffat-lto-objects -Wno-unused-local-typedefs -Wno-ignored-attributes -Wno-deprecated-declarations\n" >> $HOME/.R/Makevars

# Install rstan
# Instead, we can install rstan by restoring package library with renv (remove dependency on EczemaPredPOEM first)
RUN install2.r --error --deps TRUE \
rstan \
rstantools \
&& rm -rf /tmp/downloaded_packages/ /tmp/*.rds

# Create a user variable
ENV USER=rstudio

# Create project directory and set it as working directory
WORKDIR /home/$USER/EczemaTreat

# Install R packages to local library using renv
COPY [".Rprofile", "renv.lock", "./"]
COPY renv/activate.R ./renv/
RUN chown -R rstudio . \
&& sudo -u rstudio R -e 'renv::restore(confirm = FALSE, exclude = "TanakaData")'
13 changes: 13 additions & 0 deletions EczemaTreat.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX
Loading

0 comments on commit 6a4b2da

Please sign in to comment.