I want to make a GitHub repository with data analysis driven with R in Jupyter Notebook (JupyterLab editor). For some reason Github makes total mess out of those notebooks when opened via the website. However, when I've cloned/pulled this repository, the files worked again totally fine in JupyterLab or Jupyter Notebook. So this is not a git issue.
Is there a way to force Github to properly render the notebooks with R kernel? Some time ago it was possible in Github, and I've used that several times.
For example, this code:
df.fer <- read.xlsx("../data/data.xlsx",sheet='fermentation')
# adjusting data, creating factors, adjusting data types, etc.
df.fer$`Volume.[Nml]` <- as.numeric(df.fer$`Volume.[Nml]`) # some text artifacts are present so as.numeric has to be used
df.fer$`disintegration.temp.[oC]` <- factor(df.fer$`disintegration.temp.[oC]`,
ordered=TRUE, levels=c('in.','b.d.','45','50','55','60'))
df.fer$`disintegration.time.[h]` <- factor(df.fer$`disintegration.time.[h]`,
ordered=TRUE,levels=c('in.','0','24','48'))
# creating new factor to distinguish between case No and experiment included in a case
df.fer$case.exp <- factor(paste(df.fer$case.No, df.fer$experiment.No,sep='-'))
# changing the column names for simpler manipulation
df.fer.original.col.names <- colnames(df.fer) # just in case
df.fer.simlified.col.names <- c('day','volume','original.column.header','description','composition','inoculum.weight',
'co-substrate.weight','dis.temp','dis.time','case','experiment','disintegration.tab','case.exp')
colnames(df.fer) <- df.fer.simlified.col.names
# removing one series - it turned out to be invalid
bad.series_case.exp <- '35-1' # it will be removed in some analyses
df.fer <- df.fer[df.fer$case.exp != bad.series_case.exp,]
Renders in Github as:



.ipynb. Anything else is a third party and the support is subject to their whims. The Jupyter Community provided solution to render.ipynbfiles, no matter the kernel is, nbviewer. You can point it at essentially any.ipynbfile on the internet. Here is an example nbviewer rendering of a notebook file with the R kernel stored on GitHub. However, ...