This repository has been archived by the owner on Jan 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
76 lines (58 loc) · 1.85 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
output:
github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "inst/vignette-supp/",
tidy = TRUE
)
```
[![Travis-CI Build Status](https://travis-ci.org/sa-lee/starmie.svg?branch=master)](https://travis-ci.org/sa-lee/starmie)
[![](http://cranlogs.r-pkg.org/badges/grand-total/starmie?color=brightgreen)](http://cran.rstudio.com/web/packages/starmie/index.html)
# Quick Start
Construct a barplot for your STRUCTURE/ADMIXTURE output using `starmie` in a few
lines of code!
```{r, fig.width =8, fig.height=6, fig.align='center'}
# install.packages("starmie")
library(starmie)
str_output <- system.file("extdata/microsat_testfiles/", "locprior_K5.out_f", package = "starmie")
k5_data <- loadStructure(str_output)
k5_data
plotBar(k5_data, facet = FALSE)
```
```{r, echo = FALSE}
intro_rmd <- 'vignettes/using-starmie.Rmd'
raw_rmd <- readLines(intro_rmd)
# remove yaml
yaml_lines <- grep("---", raw_rmd)
# remove appendix (session info)
appendix <- grep("Appendix", raw_rmd)
compressed_rmd <- raw_rmd[c(-seq(yaml_lines[1], yaml_lines[2], by = 1),
-seq(appendix, length(raw_rmd)))]
writeLines(compressed_rmd, "child.Rmd")
```
```{r, child = 'child.Rmd'}
```
# Installation
`starmie` is available as an R package on CRAN
```{r, eval = FALSE}
install.packages("starmie")
```
The development version of `starmie` can be installed with `devtools`
```{r, eval = FALSE}
install.packages("devtools")
devtools::install_github("sa-lee/starmie")
```
If you would like to also build the vignette with your installation run:
```{r, eval=FALSE}
devtools::install_github("sa-lee/starmie", build_vignettes = TRUE)
```
```{r cleanup, echo=FALSE, include=FALSE}
if (file.exists("child.Rmd")) {
file.remove("child.Rmd")
}
```