# DR-SC: installation

## Install the DR.SC

This vignette provides an introduction to the R package `DR.SC`, where the function `DR.SC` implements the model `DR-SC`, spatial clustering with hidden Markov random field using empirical Bayes. The package can be installed with the following command from Github:

`install.packages('remotes')` `remotes::install_github("feiyoung/DR.SC")`

or install from CRAN

`install.packages("DR.SC")`

The package can be loaded with the command:

    library("DR.SC")
    #> 载入需要的程辑包：parallel
    #> 载入需要的程辑包：spatstat.geom
    #> Warning: 程辑包'spatstat.geom'是用R版本4.1.3 来建造的
    #> 载入需要的程辑包：spatstat.data
    #> Warning: 程辑包'spatstat.data'是用R版本4.1.3 来建造的
    #> spatstat.geom 2.4-0
    #> DR.SC :  Joint dimension reduction and spatial clustering is conducted for
    #> Single-cell RNA sequencing and spatial transcriptomics data, and more details can be referred to
    #> Wei Liu, Xu Liao, Yi Yang, Huazhen Lin, Joe Yeong, Xiang Zhou, Xingjie Shi and Jin Liu. (2022) <doi:10.1093/nar/gkac219>. It is not only computationally efficient and scalable to the sample size increment, but also is capable of choosing the smoothness parameter and the number of clusters as well.   Check out our Package website (https://feiyoung.github.io/DR.SC/index.html) for a more complete description of the methods and analyses

## Setup on Linux or MacOS system

For running big data, users can use the following system command to set the C_stack unlimited in case of `R Error: C stack usage is too close to the limit`.

    ulimit -s unlimited