R package for analysis of social defeat data
First, grab the dependencies:
install.packages(c("cluster", "mclust"), dependencies = TRUE)
If this fails, try setting a CRAN mirror
and then running the installation again.
Get the source
You can get the source from git or from a zip file.
Get the source from git
Clone the repository containing the source
git clone https://github.com/cookpa/socialdefeat.git
Get the source from a ZIP file
You can grab a ZIP file by going to the project's page and clicking the "Download ZIP" button.
Note that the ZIP file will be called "socialdefeat-master" and will unzip to a folder of that name. Rename this folder "socialdefeat".
Install the package
You need to know the path to the directory where you put the source. For example
sdPath <- "~/code/R/socialdefeat"
On Windows, you can get the path by holding down shift and right-clicking on the "socialdefeat" folder, then selecting "Copy as path".
On a Mac, you can drag the folder from Finder into the R console or a Terminal to see the path.
To check you've got the right path, do
You should see
 "DESCRIPTION" "man" "NAMESPACE" "R" "README.md"
Now you are ready to install:
install.packages(sdPath, repos=NULL, type = "source")
Loading the package for use
View the documentation
help(package = socialdefeat)
Read the function man pages for EM classification (recommended) or clustering-based classification.
The bootstrap methods return an initial classification as well as the bootstrap results.
For production purposes, use at least 1000 iterations and preferably 10000.
First unload the package:
Then remove it