Error in Install.packages : Missing Value Where True/false Needed

leastcostpath - version 1.8.0 Build Status CRAN status CRAN Downloads Month CRAN Downloads Total =============================

The R program library leastcostpath provides the functionality to calculate Be Surfaces founded on multiple cost functions that approximate the trouble of moving crosswise a landscape. Furthermore, the magnet/repulsion of landscape painting features can be incorporated into the Cost Surfaces, atomic number 3 well as barriers that inhibit movement.

Notation: The R program library leastcostpath requires the use of proposed coordinate systems. The package does not answer for for geographical co-ordinate systems.

Cost Surfaces can be used to forecast Least Cost Paths, which are often, but not exclusively, used in archaeological research. leastcostpath also provides the functionality to calculate movement potential within a landscape painting through with the implementation of From-Everyplace-to-Everywhere (Feast) (White and Barber, 2012), Additive Cost Paths (Verhagen, 2013), and Least Cost Path calculation within specified distance bands (Llobera, 2015). Furthermore, the library allows for the calculation of stochastic least price paths and wide least toll paths.

Lastly, the depository library provides functionality to validate the accuracy of computed To the lowest degree Cost Paths relative to other path.

This package is built on classes and functions provided in the R package gdistance (Van Etten, 2017).

Functions currently in developing: * force_isotropy()

Functions recently added: * create_distance_cs()

Getting Started

Installation

        #install.packages("devtools") subroutine library(devtools) install_github("josephlewis/leastcostpath") library(leastcostpath)      

Usage

Founding of Monetary value Surfaces

        library(leastcostpath) r <- raster::raster(system of rules.file('external/maungawhau.grd', package = 'gdistance'))      slope_cs <- create_slope_cs(r, cost_function = 'tobler') slope_cs_10 <- create_slope_cs(r, cost_function = 'tobler', max_slope = 10) slope_cs_exagg <- create_slope_cs(r, cost_function = 'tobler', exaggeration = TRUE)  distance_cs <- create_distance_cs(r, neighbours = 16)      

Least Cost Path figuring

        loc1 = cbind(2667670, 6479000) loc1 = sp::SpatialPoints(loc1)  loc2 = cbind(2667800, 6479400) loc2 = sp::SpatialPoints(loc2)  lcps <- create_lcp(cost_surface = slope_cs, origin = loc1, destination = loc2, directional = FALSE)  plot(raster(slope_cs)) plot(lcps[1,], add = T, gap = "red") # localisation 1 to localisation 2 secret plan(lcps[2,], add = T, col = "puritan") # localisation 2 to location 1      

Be Corridors

        cc <- create_cost_corridor(slope_cs, loc1, loc2)  plot(cubic centimetre) plot(loc1, attention deficit disorder = T) plot(loc2, add = T)      

From-Everywhere-to-All over To the lowest degree Toll Paths

        locs <- sp::spsample(as(raster::extent(r), 'SpatialPolygons'),n=10,'timed')  lcp_network <- create_FETE_lcps(cost_surface = slope_cs, locations = locs, cost_distance = FALSE, parallel = FALSE)  patch(raster(slope_cs)) plot(locs, add = T) plot(lcp_network, add = T)      

Cumulative Cost Paths

        locs <- sp::spsample(A(raster::extent(r), 'SpatialPolygons'),n=1,'random')  lcp_network <- create_CCP_lcps(cost_surface = slope_cs, location = locs, outdistance = 50, radial_points = 10, cost_distance = FALSE, parallel = FALSE)  secret plan(raster(slope_cs)) plot(locs, minimal brain damage = T) plot(lcp_network, tot = T)      

Banded Least Cost Paths

        locs <- sp::spsample(as(raster::extent(r), 'SpatialPolygons'),n=1,'random')  lcp_network <- create_banded_lcps(cost_surface = slope_cs, fix = locs, min_distance = 20, max_distance = 50, radial_points = 10, cost_distance = FALSE, parallel = FALSE)  plot(raster(slope_cs)) patch(locs, add = T) patch(lcp_network, add = T)      

Least Monetary value Path Density

        cumulative_lcps <- create_lcp_density(lcps = lcp_network, raster = r, rescale = FALSE)  plot(cumulative_lcps)      

To the lowest degree Cost Path Network

        locs <- sp::spsample(as(raster::extent(r), 'SpatialPolygons'),n=5,'regular')  mat <- cbind(c(1, 4, 2, 1), c(2, 2, 4, 3))  lcp_network <- create_lcp_network(slope_cs, locations = locs,  nb_matrix = mat, cost_distance = FALSE, synchronal = Faux)      

Random Least Monetary value Path

        locs <- sp::spsample(as(raster::extent(r), 'SpatialPolygons'),n=2,'stochastic')  stochastic_lcp <- replicate(n = 10, create_stochastic_lcp(cost_surface = slope_cs, line of descent = locs[1,], address = locs[2,], directional = FALSE))  stochastic_lcp <- get along.call(rbind, stochastic_lcp)      

Probabilistic To the lowest degree Cost Path

        locs <- sp::spsample(as(raster::extent(r), 'SpatialPolygons'),n=2,'random')  RMSE <- 5 n <- 10 lcps <- list()  for (i in 1:n) {  lcps[[i]] <- leastcostpath::create_lcp(cost_surface = leastcostpath::create_slope_cs(dem = leastcostpath::add_dem_error(dem = r, rmse = RMSE, type = "autocorrelated"), cost_function = "tobler", neighbours = 16), origin = locs[1,], name and address = locs[2,], spatial relation = FALSE, cost_distance = Sincere)  }  lcps <- brawl.call(rbind, lcps)      

Wide Least Cost Itinerary

        n <- 3  slope_cs <- create_slope_cs(r, cost_function = 'tobler', neighbours = wide_path_matrix(n))  loc1 = cbind(2667670, 6479000) loc1 = sp::SpatialPoints(loc1)  loc2 = cbind(2667800, 6479400) loc2 = sp::SpatialPoints(loc2)  lcps <- create_wide_lcp(cost_surface = slope_cs, origin = loc1, destination = loc2, path_ncells = n)      

Common Errors

        Computer error in if (is.numeric(v) &ere;& any(v < 0)) { :  missing measure where TRUE/FALSE needed      

Computer error caused when hard to calculate a To the lowest degree Be Path victimisation SpatialPoints extrinsic of the Cost Surface Extent * Check SpatialPoints used in the LCP figuring coincide with Raster / Cost Surface * Hitch coordinate systems of the Raster/Be Surface is the same As the SpatialPoints

        ```Erroneous belief in get.shortest.paths(adjacencyGraph, indexOrigin, indexGoal):``` ```At structural_properties.c:4521 :``` ```Weight vector must be non-negative, Invalid value```      

Error caused when scheming a Least Cost Path using a Cost Airfoil that contains unfavorable values. Mistake overdue to Djikstra's algorithmic rule requiring not-Gram-negative values * Check if there are negative values via:

                  ```quantile(*your_cost_surface*@transitionMatrix@x)```              

Contributing

If you would comparable to contribute to the R Package leastcostpath, please follow the "fork-and-puff" Git workflow:

  1. Fork the rep connected Github
  2. Clone the project to your own machine
  3. Commit the changes to your ain branch
  4. Push your work back to your fork
  5. Undergo a pull in request so that the changes can follow reviewed

Issues

Delight submit issues and enhancement requests via github Issues * If submitting an issue, please understandably delineate the government issue, including steps to procreate when it is a bug, or a justification for the proposed enhancement request

Case Studies Using leastcostpath

Lewis, J. Amount Modelling using Monte Carlo Simulation for Incorporating Doubtfulness in Least Cost Path Results: a Catholicity Road Case Subject, Peer Community in Archaeology, 100005. 10.24072/pci.archaeo.100005

Ludwig, B. Reconstructing the Ancient Route Network in Pergamon's Surroundings. Land 2020, 9, 241. https://doi.org/10.3390/land9080241

Versioning

See News program.md for a sum-up of Adaptation updates

  • Joseph Clive Staples Lewis - author / creator - Website

Quotation

Delight cite as:

        Carl Lewis, J. (2020) leastcostpath: Modelling Pathways and Movement Potential Within a Landscape painting (version 1.8.0).  Available at: https://cran.r-project.org/web/packages/leastcostpath/index.html      

Error in Install.packages : Missing Value Where True/false Needed

Source: https://cran.r-project.org/web/packages/leastcostpath/readme/README.html

Related Posts

0 Response to "Error in Install.packages : Missing Value Where True/false Needed"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel