Skip to content

Commit

Permalink
Format code chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
adamhsparks committed May 16, 2024
1 parent 7c03485 commit 0d513e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
3 changes: 1 addition & 2 deletions vignettes/betadiversity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ ggplot(data = princoor.pathotype.data, aes(x = X, y = Y)) +
legend.text = element_text(face = "bold", size = 10),
legend.key.size = unit(1, 'lines')
) +
stat_ellipse(data = princoor.pathotype.data, aes(x = X, y = Y),
level = 0.95) +
stat_ellipse(data = princoor.pathotype.data, aes(x = X, y = Y), level = 0.95) +
ggtitle("Pathotype Jaccard Distances PCOA")
```

Expand Down
25 changes: 11 additions & 14 deletions vignettes/hagis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ library("hagis")
head(P_sojae_survey)
```

We see in the `gene` column that each gene is prepended with "Rps".
We see in the `gene` column that each gene is pre-pended with "Rps".
We can remove this to make the graphs cleaner and report the genes in tables as we would in a manuscript.
Note that this will work for any string you enter as the first value, `pattern`.
The second string, `replacement`, is the replacement value, the third, `x`, is where to look and make the changes.
Expand Down Expand Up @@ -266,8 +266,7 @@ Set the font to be a bold-face serif family font.

```{r change-plot-font}
Rps.plot <- Rps.plot +
theme(text = element_text(face = "bold",
family = "serif"))
theme(text = element_text(face = "bold", family = "serif"))
Rps.plot
```
Expand All @@ -289,24 +288,22 @@ You can use named, *e.g.*, "red", "yellow", "blue", colors in R or you can use c
Illustrated below is using Michigan State University (MSU) Green, hex code #18453b, using `theme_bw()` with a serif font.

```{r use-Colors}
autoplot(Rps.summary,
type = "percentage",
color = "#18453b") +
autoplot(Rps.summary, type = "percentage", color = "#18453b") +
theme_bw() +
theme(text = element_text(face = "bold",
family = "serif"))
theme(text = element_text(face = "bold", family = "serif"))
```

### Sorting the x-axis

You can sort the x-axis of any graph produced using `autoplot()` in an `ascending` or `descending` order using the `order` parameter in `autoplot()`.

```{r sort-axis}
autoplot(Rps.summary,
type = "percentage",
color = "#18453b",
order = "ascending") +
autoplot(
Rps.summary,
type = "percentage",
color = "#18453b",
order = "ascending"
) +
theme_bw() +
theme(text = element_text(face = "bold",
family = "serif"))
theme(text = element_text(face = "bold", family = "serif"))
```

0 comments on commit 0d513e2

Please sign in to comment.