# 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")
    #> Loading required package: parallel
    #> Loading required package: spatstat.geom
    #> Warning: package 'spatstat.geom' was built under R version 4.2.3
    #> Loading required package: spatstat.data
    #> Warning: package 'spatstat.data' was built under R version 4.2.3
    #> spatstat.geom 3.2-4
    #> The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
    #> which was just loaded, will retire in October 2023.
    #> Please refer to R-spatial evolution reports for details, especially
    #> https://r-spatial.org/r/2023/05/15/evolution4.html.
    #> It may be desirable to make the sf package available;
    #> package maintainers should consider adding sf to Suggests:.
    #> The sp package is now running under evolution status 2
    #>      (status 2 uses the sf package in place of rgdal)
    #> 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