Coder Social home page Coder Social logo

logginglab's Introduction

LoggingLab

R-CMD-check

codecov

LoggingLab: An R Package to Simulate Forest Logging

Installation

devtools::install_github("VincyaneBadouard/LoggingLab")

Singularity container

https://github.com/sylvainschmitt/singularity-LoggingLab

Citation

To cite the package ‘LoggingLab’ in publications use:

citation("LoggingLab")

Badouard, V., Schmitt, S., Salzet, G., Gaquiere, T., Rojat, M., Bedeau, C., Brunaux, O., & Derroire, G. (2024). LoggingLab: An R package to simulate reduced-impact selective logging in tropical forests using forest inventory data. Ecological Modelling, 487, 110539. doi:10.1016/j.ecolmodel.2023.110539

logginglab's People

Contributors

ericmarcon avatar geraldinederroire avatar gsalzet avatar sylvainschmitt avatar thomasgaquiere avatar vincyanebadouard avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

logginglab's Issues

plots

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

selected

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

futurereserve

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

treeselection

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

maintrailextract

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Lowlands definition

We need to define lowlands, to define the UPs.

Several possibilities :

  • altitude relative à la crique
  • TWI (TopoWetnessIndex)
    - Rsaga : Saga has to be downloaded (external dependence). We cannot force the user to download it, nor can we download it for him. Need to be optional. (possibly not all the TWI formulas)
    - reuse Saga's codes (all the formulas)
    - package "dynatopmodel" : only 1 TWI formule

Computation time (ONF, Guyafor) and necessary precision (SRTM/LIDAR) to be taken into account

treefelling

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

preliminary functions

inventorycheckformat

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

addtreedim

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Private "broken dataset" location

I created a broken dataset to test my "datacheckformat" function (check & control my inventory dataset.
When I put my script creating this "broken dataset", in data-raw folder (with use_data_raw()),
usethis says me to add this data to the package with usethis::use_data().
For my part, I put this data in inst/extdata because I don't want to give acces to this data at users
What I had to do ? put this data in data folder or in inst/extdata? @sylvainschmitt

createcanopy

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

How to stock data in a R package

Vincyane question

  • Testing data
  • Default data
    • Species criteria (minimum diameter, economic interest...)
    • Global parameters (track size ...)

cleaninventory

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

loggingparameters

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Genericity

I think we need to discuss the generecity of Maria if we want to publish it. I can't do it in code review because it is global to the package. So for the moment I'll stop making remarks about it. And I think it is not an issue for the version 1 that you are planning for the ONF / contract end. But we should discuss it with Geraldine when she come back from holidays.

harvestablearea

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

loggingsummary

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

How to implement logging pre-defined scenarii and manual parameters?

If I have scenarios to simulate, and the parameters of these scenarios are the arguments of my function,
ex : scenario 1 : A = 1, B = 4, C = 10
manual: we choose the values of A, B and C
fun(scenario, A, B, C)

what is the best strategy?

  • create a table from which the function will take the values of the arguments (overwriting those that the user could have put)

  • lines of code at the beginning of each function to assign values to the arguments according to the chosen scenario

  • put in the code the scenarios, and consider the arguments only in the "manual" mode
    @sylvainschmitt

secondarytrails

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Increase user-friendliness

To increase user-friendliness, I'm implementing new developments on personal branches of my fork (uf_basic, uf_intermediate, and uf-advance). The developments are:

Basic

  • Remove checks for unused columns PlotArea
  • Remove checks for unused columns VernName, Circ, Xfield, Yfield, Lat, Lon
  • Check Plot column only if present
  • Check CensusYear column only if present
  • Ease basic types inputs with autoconversion tests (with as.integer, as.logical and as.character)
  • Ease table types inputs with autoconversion (DT & tibble & data.frame)
  • Ease spatial types inputs with autoconversion (raster & terra, sp & sf)
  • Add a stop if check/prepare inputs remove all lines
  • Add a message if DBH or diameter column exists but not Circ
  • Check DBH interval (1cm to 10m)

Intermediate

  • Replace creekdistances argument for a named list with two arguments for two raster inputs
  • Add an helper function to creat the mask

Advance

  • Replace LoggingSimulationOutputs and LoggingSimulationOutputs_iter by new R objects with associated class to simplify and consolidate outputs and ease package use with commonly known methods (loggingsummary & loggingsummary1 to summary, show, print, autoplot)

harvestable

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

landings

ONF's version

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Issue in `maintrailextract()`

@thomasgaquiere , what is the purpose off the following lines:

preMainTrails <- DTMExtended > -Inf
preMainTrails<- rasterToPolygons(preMainTrails, dissolve=T)

Using a dummy raster of 20m height, this provoke a bug in my last install because of multiple polygons:

dem <- raster::raster(mask, nrow = 200, ncol = 200)
values(dem) <- rep(20, length(values(dem)))
maintrailextract(dem)
# Erreur dans st_cast.sfc(st_geometry(x), to, group_or_split = do_split) : 
# use smaller steps for st_cast; first cast to MULTILINESTRING or POLYGON?

This is because the multiple polygons can't be casted into one linestring here:

MainTrails <- preMainTrails %>% st_as_sf() %>% st_cast(to = 'LINESTRING', warn= FALSE)

getgeometry

  • code
  • test
  • document (V0)
  • Sylvain's check (code)
  • Geraldine check (doc)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.