I’m using the computional cluster to run R enviroment. But I haven’t got the access to the root or sudoers.
Usually, I will choose Docker to set up a totally independent enviroment. This doesn’t work right now, because to launch a docker daemon, you have to get the permission to access root.
I use linuxbrew to set up the enviroment at first. But sometimes it won’t work as well when it comes to the library dependencies.
The mainly reason is that linuxbrew just installs some softwares into the user’s directory, but we still depend on some system libraries and so on. For example, I found that the version of libstdc++ does not meet a software.
I installed all version of gcc and tried to substitute all correlated library to these system ones. However, even vim refuse to work right now.
Good news are that I recently Anaconda can support building a R enviroment friendly.
First of all, download the Anaconda3-2018.12-Linux-x86_64.sh according your operating system.
Then install softwares, I need library Seurat, so some softwares are needed:
1 | sh Anaconda3-2018.12-Linux-x86_64.sh |
Then install all library you need inner R
1 | install.packages("hdf5r") |
rmarkdown generate pdf
It is easy to generate html using through knit. However, sometimes pdf generating will be an obstacle. The most common advise is Pandoc.
However, when I try to generate pdfs, I found all format good in html became really unacceptable. After some search, I decided to generate PDF through webshot library in R. The installation step is as follows:1
2install.packages("webshot")
webshot::install_phantomjs()
Now you can generate pdf through Rscript:
1 | library(webshot) |
Problems emerged when opened the pdf file due to the pages. Because webshot generates pdf with a huge page without break, it is hard for pdf viewer to load a page. So I had to find anothe software. html-pdf can solve the pages problem, to install:
1 | conda install nodejs |
Estar egg: knitter script for Rmd to generate html or pdfs
I just improve a script from stackoverflow
1 | !/bin/sh |