Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing pkgkdown and some other warnings #110 #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/Deploy-pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ jobs:

- name: Install additional package dependencies
run: |
repos.orig <- getOption('repos')
options(repos = c(PE = "https://predictiveecology.r-universe.dev")) ## TODO: use ropensci universe
pak::pkg_install("RandomFields")
options(repos = repos.orig)
pak::pkg_install("cran/RandomFieldsUtils")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R-universe will only pick up dependencies from DESCRIPTION.

pak::pkg_install("cran/RandomFields")
shell: Rscript {0}

- name: Build site
Expand Down
2 changes: 0 additions & 2 deletions CRAN-RELEASE

This file was deleted.

8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ License: GPL-3
URL: https://ropensci.github.io/NLMR/
BugReports: https://github.com/ropensci/NLMR/issues/
Depends:
R (>= 3.1.0)
R (>= 3.6)
Imports:
checkmate,
dplyr,
Expand All @@ -49,6 +49,7 @@ Imports:
Suggests:
ggplot2,
highcharter,
igraph,
knitr,
kableExtra,
landscapemetrics,
Expand All @@ -63,7 +64,7 @@ Suggests:
rayshader,
rgl,
rmarkdown,
testthat,
testthat (>= 3.0.0),
viridis
LinkingTo:
Rcpp
Expand All @@ -76,5 +77,6 @@ Config/Needs/website: bindrcpp, igraph, landscapemetrics, rasterVis, pals,
Encoding: UTF-8
LazyData: true
Roxygen: list(roclets = c("rd", "namespace", "collate"))
RoxygenNote: 7.2.1
RoxygenNote: 7.3.2
Config/testthat/edition: 3
SystemRequirements: C++11
1 change: 1 addition & 0 deletions NLMR.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: c60b485c-12be-40a7-be11-f785e3cf8c20

RestoreWorkspace: Default
SaveWorkspace: Default
Expand Down
18 changes: 9 additions & 9 deletions R/nlm_mpd.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
#' algorithm.
#' It performs the following steps:
#'
#' \itemize{
#' \item{Initialization: }{ Determine the smallest fit of
#' \code{max(ncol, nrow)} in \emph{n^2 + 1} and assign value to n.
#' Setup matrix of size (n^2 + 1)*(n^2 + 1).
#' Afterwards, assign a random value to the four corners of the matrix.}
#' \item{Square Step: }{ For each square in the matrix, assign the average of
#' \describe{
#' \item{Initialization:}{Determine the smallest fit of
#' \code{max(ncol, nrow)} in \emph{n^2 + 1} and assign value to n. Setup matrix of
#' size (n^2 + 1)*(n^2 + 1). Afterwards, assign a random value to the four corners
#' of the matrix.}
#' \item{Square Step:}{For each square in the matrix, assign the average of
#' the four corner points plus a random value to the midpoint of that square.}
#' \item{Diamond Step: }{ For each diamond in the matrix, assign the average
#' \item{Diamond Step:}{For each diamond in the matrix, assign the average
#' of the four corner points plus a random value to the midpoint of that
#' diamond.}
#' }
Expand Down Expand Up @@ -79,12 +79,12 @@ nlm_mpd <- function(ncol,
# create the landscape with rcpp_mpd ----
seed <- sample.int(.Machine$integer.max, 1)
mpd_raster <- rcpp_mpd(ncol, nrow, rand_dev, roughness, seed, torus)

mpd_raster <- mpd_raster[-1,]
mpd_raster <- mpd_raster[,-1]
mpd_raster <- mpd_raster[-nrow(mpd_raster),]
mpd_raster <- mpd_raster[,-ncol(mpd_raster)]

# Convert matrix to raster ----
mpd_raster <- raster::raster(mpd_raster)

Expand Down
6 changes: 3 additions & 3 deletions R/nlm_percolation.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#' @details
#' The simulation of a random percolation map is accomplished in two steps:
#'
#' \itemize{
#' \item{Initialization: }{ Setup matrix of size (\code{ncol}*\code{nrow})}
#' \item{Map generation: }{ For each cell in the matrix a single uniformly
#' \describe{
#' \item{Initialization:}{Setup matrix of size (\code{ncol}*\code{nrow})}
#' \item{Map generation:}{For each cell in the matrix a single uniformly
#' distributed random number is generated and tested against a probability
#' \code{prob}. If the random number is smaller than \code{prob}, the cell is set to
#' TRUE - if it is higher the cell is set to FALSE.}
Expand Down
6 changes: 2 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ knitr::opts_chunk$set(

[![R-CMD-check](https://github.com/ropensci/NLMR/workflows/R-CMD-check/badge.svg)](https://github.com/ropensci/NLMR/actions)
[![codecov](https://codecov.io/gh/ropensci/NLMR/branch/develop/graph/badge.svg?token=MKCm2fVrDa)](https://codecov.io/gh/ropensci/NLMR)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/NLMR)](https://cran.r-project.org/package=NLMR)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![](http://cranlogs.r-pkg.org/badges/grand-total/NLMR)](http://cran.rstudio.com/web/packages/NLMR/index.html)
[![](https://badges.ropensci.org/188_status.svg)](https://github.com/ropensci/onboarding/issues/188)
[![Lifecycle](https://img.shields.io/badge/Lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![ropensci](https://badges.ropensci.org/188_status.svg)](https://github.com/ropensci/onboarding/issues/188)
[![DOI:10.1111/2041-210X.13076](https://zenodo.org/badge/DOI/10.1111/2041-210X.13076.svg)](https://doi.org/10.1111/2041-210X.13076)

<!-- badges: end -->
Expand Down
2 changes: 2 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
url: https://ropensci.github.io/NLMR/

reference:
- title: Neutral Landscape Models
desc: ~
Expand Down
14 changes: 7 additions & 7 deletions man/nlm_mpd.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/nlm_percolation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions tests/testthat.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
library(testthat)
library(NLMR)

test_check("NLMR")
# This file is part of the standard setup for testthat.
# It is recommended that you do not modify it.
#
# Where should you do additional test configuration?
# Learn more about the roles of various files in:
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
# * https://testthat.r-lib.org/articles/special-files.html

library(testthat)
library(NLMR)

test_check("NLMR")
3 changes: 3 additions & 0 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# load additional packages

library(igraph)
Loading