Git Product home page Git Product logo

agbfluxes's People

Contributors

maurolepore avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fdbesanto2

agbfluxes's Issues

Fix DESCRIPTION file.

From @maurolepore on September 18, 2018 14:42

About your DESCRIPTION file:

  • Type: I'm not sure what this field does.
  • Version: Consider using a development version until released. The book R Packages recommends adding .9000 to the end of a development verison number to clearly indicate it is not a released version.
  • Authorand Maintainer: Both fields can be documented with person()`. For an example see: https://github.com/forestgeo/fgeo/blob/master/DESCRIPTION

In general

The easiest way to create a good DESCRIPTION file is by using the one you get when you create a new package with usethis::create_package(), then add infrastructure as you need it (e.g. usethis::use_gpl3_license().

Copied from original issue: ErvanCH/AGBflux_pack#4

Failed to build the package

Hey Mauro,
I have a couple of changes to the package (remove stuff and update scripts). I'd like now to rebuild the package to get the ints/extdata/data folder updated and use it to update the readme.
However, after having passed the check, I can install and build the package. It says that "data.table" is missing... (see below). Any clue?
image

Join forces to develop taper correction

From: Helene Muller-Landau
Sent: Friday, October 12, 2018 10:07:01 AM (UTC-05:00) Eastern Time (US & Canada)
To: KC Cushman; Ervan Rutishauser; Lepore, Mauro
Subject: biomass R package for ForestGeo plots

KC is analyzing taper for multiple plots and testing alternative methods to handle changes in points of measurement. Ervan and Mauro are working on an R package for biomass stock and flux estimates at ForestGEO plots, including the taper correction as part of that. Ervan also mentioned that in working with Mauro on that, Mauro told him about an R function (regression test if I remember the name?) that can help in assessing how code changes propagate to output changes, which was itself useful.

KC, I suggest you share a draft of the manuscript with Ervan and Mauro. And perhaps the three of you, or some subset, should chat about whether some of this could or should be incorporated into the R package.

Restructure .R files

What are your main functions? There should be one .R file per main function and its helpers.

Document source and details of datasets

  • Document the souce of each raw dataset and how to go from raw to clean data in a file in data-raw/data.R.
  • Documet details of each dataset in R/data.R (or R/dataset1.R, R/dataset2.R, etc.).

Document all exported functions

From @maurolepore on September 18, 2018 15:8

Running devtools::check() should warn you if the documentation of any function is incomplete (find more details here; http://r-pkgs.had.co.nz/check.html).

One good way to not miss any important piece of documentation is to step on the function's name and press Ctrl + Shift + Alt + R. That will automatically write the roxygen skeleton of key documentation inluding all parameters. You can also Insert Roxygen Skeleton form the Code menu:

image

Copied from original issue: ErvanCH/AGBflux_pack#8

PRIORITY: Help me run data_preparation()

RE: On Thu, Oct 4, 2018 at 8:22 AM Ervan Rutishauser [email protected] wrote:

The main function works fine on my end. Could you test and let me know, please?

Unfortunately it fails on my end. I tried from the AGBfluxes package itself, and from a new project with just the data (image below). Can you see what I'm doing wrong?

image

Error in assignWD(df, WD = WD) : object 'WD' not found

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/, https://community.rstudio.com/, https://github.com/forestgeo/forum/ or email Mauro Lepore at [email protected].

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Brief description of the problem

# insert reprex here

Add a website

From @maurolepore on September 18, 2018 14:51

A package website can host any metadata associated to your package including documentation showing how to use your package. For example: https://forestgeo.github.io/fgeo/.

You can build (and update) a package website by running pkgdown::build_site(). The website will live in the folder docs/. To host on GitHub go to: Settings > GitHubPages > Source > master branch /docs folder. This mute video shows the process: https://www.youtube.com/watch?v=QVxJyQm-pBg&index=10&list=PLvgdJdJDL-AOJKDiV6U09LdOYOTgFpQqN&t=1s

Copied from original issue: ErvanCH/AGBflux_pack#6

README: Add relevant information

From @maurolepore on September 18, 2018 14:46

I believe you already created the skeleton of a readme file with usethis::use_readme_rmd(). It doesn't yet appear on GitHub, meaning that you haven't pushed it yet.

The information in README will appear at the Home of the package website, and also on the front page of your package repository. README should cover the goal of the package, installation instructions, and an example. Remember to knit that .Rmd file whenever you update it. That will generate a .md version. Don't edit the .md version; edit the .Rmd only.

Copied from original issue: ErvanCH/AGBflux_pack#5

Remove or rename `df`

The object DF gets saved as df, and this is a problems because it clashes with stats::df(). I renamed df to dfm, but it seems that this object isn't used. Should we remove it?

Give sensible defaults to simplify the interface

Now, data_preparation() has a lot of arguments, and many of them are compulsory. This makes it difficult for users to use because they need to type a lot. Better is to provide sensible defaults for as much as possible.

Error: package or namespace load failed for 'AGBfluxes' in namespaceExport(ns, exports)

Please briefly describe your problem and what output you expect. If you have a question, please don't use this form. Instead, ask on https://stackoverflow.com/, https://community.rstudio.com/, https://github.com/forestgeo/forum/ or email Mauro Lepore at [email protected].

Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Brief description of the problem

# insert reprex here

Hide internal functions

Do you don't need to @export all these functions? If some functions are internal the code becomes more flexible because it's easier to change internal functions than exported ones. Also we can save some time because internal functions don't need very deep documentation.

Can't install the package

Hi Mauro,

I tried to install the package I pushed today to get all objects and the functions to work poperly, but it fails. Here is what I got after having called:
install_github("forestgeo/AGBfluxes",force=T)

..
(lots of stufff)
..
** testing if installed package can be loaded
Error: package or namespace load failed for 'AGBfluxes' in namespaceExport(ns, exports):
undefined exports: data_correction
Error: loading failed
Execution halted
ERROR: loading failed

Any hint?

Show what your package does

From @maurolepore on September 18, 2018 15:39

Show me and other users what your package does. You'll can show some features in README (ErvanCH/AGBflux_pack#5). To show more you can use a vignette (usethis::use_vignette()). Vignettes are a great place to show more complex examples and also to show how your package relates to other packages.

Copied from original issue: ErvanCH/AGBflux_pack#17

Follow a style guide

From @maurolepore on September 18, 2018 15:18

I recommend this style guide http://style.tidyverse.org/ because it is well documented and current.

You can re-format code with Control + Shift + A. This will add spaces after commas, brake lines to fit within 80 characters width, add spaces around equal signs, etc. You may dislike that formatting style butitiseasiertoread. Also see the styler package and the function goodpractice::gp().

Some specific comments:

  • Consider grouping functions in files by topic.

  • Avoid using tab to insert spaces. Instead use space.

  • Keep the widh of each line no longer than 80 characters. This improves readability. To achive this:

    • Set a guide line at 80 characters page width: Tools > Global Options > Code > Display > Show Margin > Margin Column = 80.

    • For comments (both normal comments and roxygen comments), master these two keyboard shortcuts:

      • Shift + Control + C to comment a line/paragraph.
      • Shift + Control + / to brake a paragraph into lines no longer than 80 characters.

Copied from original issue: ErvanCH/AGBflux_pack#11

Document changes

Hi Mauro,

Thanks for your help. I am working in background to fix/update/examplify the functions. While running my code again for my paper, I got a strange behaviour and I found the problem.
In function "computeAGB" (l, 466-481), you probably cleaned up the following expression

df['Family' == "Arecaceae", "agb" := agbPalm(dbh2)]
by
df["Family" == "Arecaceae", "agb" := agbPalm(dbh2)]

However, data.table doesn't know how to deal with " " and fails to do the job (and messed up my whole analysis).
Shall I kindly ask you to document all changes that you are doing for me to double check, please.
Thanks
Ervan

Add tests

From @maurolepore on September 18, 2018 15:12

You are already testing, but likely in a non-systematic way: you write a function, run it, and see its output on the console to check check if it's right. You will save you a lot of time if you test systematically, with an automatic unit testing system such as the testthat package. To use testthat run:

usethis::use_testthat()

Then you will see tests/ in the root directory of your package. Then you add new tests with:

usethis::use_test("name-of-the-file-containing-the-functions-you-want-to-test")

This video shows the testing workflow: https://youtu.be/Ajtfdc2hnxo

Copied from original issue: ErvanCH/AGBflux_pack#10

Add tests

From @maurolepore on September 18, 2018 15:12

You are already testing, but likely in a non-systematic way: you write a function, run it, and see its output on the console to check check if it's right. You will save you a lot of time if you test systematically, with an automatic unit testing system such as the testthat package. To use testthat run:

usethis::use_testthat()

Then you will see tests/ in the root directory of your package. Then you add new tests with:

usethis::use_test("name-of-the-file-containing-the-functions-you-want-to-test")

This video shows the testing workflow: https://youtu.be/Ajtfdc2hnxo

Copied from original issue: ErvanCH/AGBflux_pack#10

Update data/

Ervan has data that is a little different from what master has. The source of the data was Ervan, anyway (see data-raw) so adding this data manually now is no different form what it was originally.

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.