Skip to content

Commit

Permalink
fix paths for vignette figures
Browse files Browse the repository at this point in the history
  • Loading branch information
fmichonneau committed Oct 6, 2022
1 parent 18a631b commit c462a8c
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 20 deletions.
7 changes: 5 additions & 2 deletions vignettes/data_mashups.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ vignette: >
\usepackage[utf8]{inputenc}
---




## Combining data from OToL and other sources.

One of the major goals of `rotl` is to help users combine data from other
Expand Down Expand Up @@ -300,7 +303,7 @@ tr <- tol_induced_subtree(ott_ids = ott_in_tree)
plot(tr)
```

![plot of chunk subtree](figure/subtree-1.png)
![plot of chunk subtree](fig-vignettes-subtree-1.png)

### Connect your data to the tips of your tree

Expand Down Expand Up @@ -363,7 +366,7 @@ And now we can plot the data and the tree together
plot(tree_data)
```

![plot of chunk unnamed-chunk-1](figure/unnamed-chunk-1-1.png)
![plot of chunk unnamed-chunk-1](fig-vignettes-unnamed-chunk-1-1.png)

## Find external data associated with studies, trees and taxa from Open Tree

Expand Down
5 changes: 5 additions & 0 deletions vignettes/data_mashups.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ vignette: >
\usepackage[utf8]{inputenc}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.path = "fig-vignettes-")
```


## Combining data from OToL and other sources.

One of the major goals of `rotl` is to help users combine data from other
Expand Down
Binary file added vignettes/fig-vignettes-birds_in_a_tree-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-eggs_in_a_funnel-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-subtree-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-unnamed-chunk-1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-unnamed-chunk-16-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vignettes/fig-vignettes-unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 2 additions & 13 deletions vignettes/make-vignettes.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,9 @@ make_vignettes <- function() {
knitr::knit(x, output = y)
}
)
## clean figure directory if it exists
if (dir.exists("vignettes/figure")) {
unlink("vignettes/figure/", recursive = TRUE, force = TRUE)
}
## recreate the directory
dir.create("vignettes/figure")
## move the figures
figures <- list.files("figure", pattern = "\\.png$", full.names = TRUE)
figures <- list.files(".", pattern = "fig-vignettes-.+\\.png$", full.names = TRUE)
res_mv <- file.rename(figures, file.path("vignettes", figures))
stopifnot(all(res_mv))

## remove base directory
unlink("figure", recursive = TRUE, force = TRUE)

## returns TRUE is everything worked
invisible(!dir.exists("figure"))
TRUE
}
6 changes: 4 additions & 2 deletions vignettes/meta-analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ vignette: >
%\VignetteEncoding{UTF-8}
---



## Phylogenetic Comparative Methods

The development of phylogenetic comparative methods has made phylogenies and
Expand Down Expand Up @@ -106,7 +108,7 @@ plot(1 / sqrt(egg_data$VZr), egg_data$Zr,
)
```

![plot of chunk eggs_in_a_funnel](figure/eggs_in_a_funnel-1.png)
![plot of chunk eggs_in_a_funnel](fig-vignettes-eggs_in_a_funnel-1.png)

In order to use this data later on we need to first convert it to a standard
`data.frame`. We can also convert the `animal` column (the species names) to
Expand Down Expand Up @@ -317,7 +319,7 @@ tr <- tol_induced_subtree(ott_id(taxa)[is_in_tree(ott_id(taxa))])
plot(tr, show.tip.label = FALSE)
```

<img src="figure/birds_in_a_tree-1.png" title="plot of chunk birds_in_a_tree" alt="plot of chunk birds_in_a_tree" style="display: block; margin: auto;" />
<img src="fig-vignettes-birds_in_a_tree-1.png" title="plot of chunk birds_in_a_tree" alt="plot of chunk birds_in_a_tree" style="display: block; margin: auto;" />

There are a few things to note here. First, the tree has no branch lengths.
At present this is true for the whole of the Open Tree synthetic tree. Some
Expand Down
4 changes: 4 additions & 0 deletions vignettes/meta-analysis.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ vignette: >
%\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.path = "fig-vignettes-")
```

## Phylogenetic Comparative Methods

The development of phylogenetic comparative methods has made phylogenies and
Expand Down
8 changes: 5 additions & 3 deletions vignettes/rotl.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ vignette: >
\usepackage[utf8]{inputenc}
---



`rotl` provides an interface to the Open Tree of Life (OTL) API and allows users
to query the API, retrieve parts of the Tree of Life and integrate these parts
with other R packages.
Expand Down Expand Up @@ -143,7 +145,7 @@ my_tree <- tol_induced_subtree(ott_ids = resolved_names$ott_id)
plot(my_tree, no.margin = TRUE)
```

![plot of chunk unnamed-chunk-3](figure/unnamed-chunk-3-1.png)
![plot of chunk unnamed-chunk-3](fig-vignettes-unnamed-chunk-3-1.png)


## FAQ
Expand Down Expand Up @@ -366,7 +368,7 @@ mono_tree <- tol_subtree(ott_id = ott_id(mono_id))
plot(mono_tree)
```

![plot of chunk unnamed-chunk-8](figure/unnamed-chunk-8-1.png)
![plot of chunk unnamed-chunk-8](fig-vignettes-unnamed-chunk-8-1.png)


### How do I find trees from studies focused on my favourite taxa?
Expand Down Expand Up @@ -666,4 +668,4 @@ tr <- tol_induced_subtree(ott_id(taxa))
plot(tr)
```

![plot of chunk unnamed-chunk-16](figure/unnamed-chunk-16-1.png)
![plot of chunk unnamed-chunk-16](fig-vignettes-unnamed-chunk-16-1.png)
4 changes: 4 additions & 0 deletions vignettes/rotl.Rmd.orig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ vignette: >
\usepackage[utf8]{inputenc}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(fig.path = "fig-vignettes-")
```

`rotl` provides an interface to the Open Tree of Life (OTL) API and allows users
to query the API, retrieve parts of the Tree of Life and integrate these parts
with other R packages.
Expand Down

0 comments on commit c462a8c

Please sign in to comment.