From 1475a3e887080a015d814a219a6b2d1b4b68109e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Greni=C3=A9?= Date: Wed, 20 Mar 2024 08:50:28 +0100 Subject: [PATCH] Warn memoise with caution (fixes #71 #77) --- vignettes/fundiversity.Rmd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vignettes/fundiversity.Rmd b/vignettes/fundiversity.Rmd index 4f8d051..4983511 100644 --- a/vignettes/fundiversity.Rmd +++ b/vignettes/fundiversity.Rmd @@ -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()` @@ -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()` @@ -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()`