Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.7%) to scientific vocabulary
Repository
A landscape simulator for R
Basic Info
- Host: GitHub
- Owner: dariomasante
- Language: HTML
- Default Branch: master
- Size: 3.03 MB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 2
- Releases: 5
Metadata Files
README.md
landscapeR
A landscape simulator for R. This package is aimed at simulating categorical landscapes on actual geographical realms, starting from either empty landscapes or landscapes provided by the user (e.g. land use maps). The purpose is to provide a tool to tweak or create the landscape while retaining a high degree of control on its features, without the hassle of specifying each location attribute. In this it differs from other tools which generate null or neutral landscape in a theorethical space. All basic GIS operations are handled by the raster package.
URL: https://cran.r-project.org/package=landscapeR
Reference manual: landscapeR.pdf
Citation: Thomas, A., Masante, D., Jackson, B., Cosby, B., Emmett, B., Jones, L. (2020). Fragmentation and thresholds in hydrological flow-based ecosystem services. Ecological Applications. https://doi.org/10.1002/eap.2046
To install, open a R session and select 'landscapeR' from the packages list, or type in the console:
r
install.packages("landscapeR")
Alternatively to install from source:
- download the source file (.tar.gz) to the R working directory (or any other directory)
- start an R session
- run the following commands in the console:
``` r
Install the required packages
install.packages("raster", dependencies=T, clean=T)
Install landscapeR (full path to the file, if not in the R working directory)
install.packages("~/landscapeR_1.3.tar.gz", repos = NULL, type="source")
Here it follows a set of examples, using landscapeR functions to generate various landscape configurations.
Similar examples are showed in the [vignette](http://htmlpreview.github.com/?https://github.com/dariomasante/landscapeR/blob/master/landscapeR.html).
Let's start loading the required packages and making an empty landscape (by transforming a matrix into a geographical obkect):
{r, message=FALSE, warning=FALSE}
library(landscapeR)
Create an empty landscape
library(terra) m = matrix(0, 33, 33) r = rast(m) ext(r) = c(0, 10, 0, 10) ```
makePatch
This is the basic function to create a single patch. For instance:
{r, eval=FALSE}
rr = makePatch(r, size=500, rast=TRUE)
plot(rr)
Some more features can be specified about the patch. For example, the following will create a patch with value 3, starting from the centre cell of the raster:
{r}
patchSize = 500
newVal = 3
centre = 545
rr = makePatch(r, patchSize, centre, val=newVal, rast=TRUE)
plot(rr)
Forbidden cells can be specified by value, so the patch will occupy only the allowed background. The following will generate a new patch with value 5 and size 100 inside the existing patch:
{r, warning=FALSE}
rr = makePatch(rr, 100, bgr=newVal, rast=TRUE, val=5)
plot(rr)
makeClass
makeClass generates a group of patches, as specified by its arguments. Example:
{r, warning=FALSE}
num = 5
size = 15
rr = makeClass(r, num, size)
plot(rr)
Patches are allowed to be contiguous, so they may appear as a single patch in those instances:
{r, warning=FALSE}
num = 75
size = 10
rr = makeClass(r, num, size)
plot(rr)
Each patch size and seed starting position can be specified as well:
{r}
num = 5
size = c(1,5,10,20,50)
pts = c(1, 33, 1089, 1057, 545)
rr = makeClass(r, num, size, pts)
plot(rr)
expandClass
Expand (and shrinks) classes starting from an existing landscape. Building on the previous:
{r}
rr = expandClass(rr, 1, 250)
plot(rr)
This function can be used to mimic shapes, by providing a skeleton:
{r}
m[,17] = 1
r = rast(m)
ext(r) = c(0, 10, 0, 10)
par(mfrow=c(1,2))
plot(r)
rr = expandClass(r, 1, 200)
plot(rr)
makeLine
Create a linear patch, setting direction and convolution. The higher the convolution degree, the weaker the linear shape (and direction). ```{r} par(mfrow=c(1,2)) rr = makeLine(r, size=50, direction=90, rast=TRUE, spt=545, convol=0.25) plot(rr)
plot(makeLine(r, size=50, direction=90, rast=TRUE, spt=545, convol=0.6)) ```
GitHub Events
Total
- Issue comment event: 3
- Push event: 4
- Pull request event: 4
Last Year
- Issue comment event: 3
- Push event: 4
- Pull request event: 4
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Dario Masante | d****e | 31 |
| dariomasante | d****e@g****m | 22 |
| MASANTE Dario | d****e@e****u | 2 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 2 years ago
All Time
- Total issues: 2
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- dariomasante (2)
Pull Request Authors
- LMurphy186232 (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 324 last-month
- Total dependent packages: 0
- Total dependent repositories: 2
- Total versions: 8
- Total maintainers: 1
cran.r-project.org: landscapeR
Categorical Landscape Simulation Facility
- Homepage: https://github.com/dariomasante/landscapeR
- Documentation: http://cran.r-project.org/web/packages/landscapeR/landscapeR.pdf
- License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
-
Latest release: 1.3.1
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- Rcpp >= 1.0.3 imports
- raster * imports
- knitr * suggests
- markdown * suggests