Skip to content

Commit

Permalink
Warn memoise with caution (fixes #71 #77)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Grenié committed Mar 20, 2024
1 parent d56a970 commit 1475a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vignettes/fundiversity.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Each row gives the standardized FRic values of each site.

**Parallelization**. The computation of this function can be parallelized thanks to the `future` package. Refer to the [parallelization vignette](./fundiversity_1-parallel.html) to get more information about how to do so.

**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed (their results are cached to avoid recomputing the same functional volume twice). To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. If you use it interactively it will only affect your current session. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time. By changing the option, the behavior will automatically change the next time you run the function. **Note**: memoisation is only available when the `memoise` package has been installed **and without parallelization**, otherwise `fundiversity` will use unmemoised versions of the functions.
**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed (their results are cached to avoid recomputing the same functional volume twice). It means repeated call to `fd_fric()` with the same arguments won't be recomputed but recovered from cache. To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. By changing the option, the behavior will automatically change the next time you run the function. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time. By changing the option, the behavior will automatically change the next time you run the function. **Important note**: memoisation is only available when the `memoise` package has been installed **and without parallelization**, otherwise `fundiversity` will use unmemoised versions of the functions.


# Functional volume intersect (FRic_intersect) - `fd_fric_intersect()`
Expand Down Expand Up @@ -164,7 +164,7 @@ Note that when standardizing the volumes, the behavior is similar to that of `fd

**Parallelization**. The computation of this function can be parallelized thanks to the `future` package. Refer to the [parallelization vignette](./fundiversity_1-parallel.html) to get more information about how to do so.

**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed. It means that repeated calls to `fd_fric_intersect()` with similar arguments won't be recomputed each time but recovered from memory. To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. If you use it interactively it will only affect your current session. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time.
**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed. It means that repeated calls to `fd_fric_intersect()` with similar arguments won't be recomputed each time but recovered from memory. To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. By changing the option, the behavior will automatically change the next time you run the function. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time. **Important note**: memoisation is only available when the `memoise` package has been installed **and without parallelization**, otherwise `fundiversity` will use unmemoised versions of the functions.


# Functional Divergence (FDiv) - `fd_fdiv()`
Expand Down Expand Up @@ -215,7 +215,7 @@ Similarly to FRic, if the included species differ between the site-species matri

The computation of this function can be parallelized thanks to the `future` package. Refer to the [parallelization vignette](./fundiversity_1-parallel.html) to get more information about how to do so.

**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed. It means that repeated calls to `fd_fdiv()` with similar arguments won't be entirely recomputed each time but recovered from memory. To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. If you use it interactively it will only affect your current session. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time.
**Memoization**. By default, when loading `fundiversity`, the functions to compute convex hulls are [memoised](https://en.wikipedia.org/wiki/Memoization) through the `memoise` package if it is installed (their results are cached to avoid recomputing the same functional volume twice). It means repeated call to `fd_fdiv()` with the same arguments won't be recomputed but recovered from cache. To deactivate this behavior you can set the option `fundiversity.memoise` to `FALSE` by running the following line: `options(fundiversity.memoise = FALSE)`. By changing the option, the behavior will automatically change the next time you run the function. Add it to your script(s) or `.Rprofile` file to avoid toggling it each time. By changing the option, the behavior will automatically change the next time you run the function. **Important note**: memoisation is only available when the `memoise` package has been installed **and without parallelization**, otherwise `fundiversity` will use unmemoised versions of the functions.


# Functional Dispersion (FDis) - `fd_fdis()`
Expand Down

0 comments on commit 1475a3e

Please sign in to comment.