GithubHelp home page GithubHelp logo

agrdatasci / climatrends Goto Github PK

View Code? Open in Web Editor NEW
4.0 8.0 6.0 18.77 MB

Climate Variability Indices for Ecological Modelling

License: MIT License

R 73.04% TeX 26.96%
climate-data climatology timeseries-analysis

climatrends's People

Contributors

dlebauer avatar istfer avatar kauedesousa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

climatrends's Issues

cbean dataset

I was trying the cbean example in the JOSS paper starting on line 148:

library(climatrends)
library(PlackettLuce)
library(tidyverse)

# number of days required to accumulate gdd from planting date to maturity
gdd <- GDD(modis,
           day.one = cbean$planting_date,
           degree.days = 900,
           return.as = 'ndays')

which assumes the cbean dataset is loaded to the environment.

The dataset is linked on line 130, but I'm not sure this is a proper/preferred way. Maybe this dataset could be included in the package like the other example datasets (i.e. load by data("cbean", package = "climatrends")), or it could be deposited to some repository and linked/loaded that way.

can not find function 'get_power'

I get an error when I run this code from the vignette:

library(climatrends)
    lonlat <- data.frame(lon = 129.19,
                         lat = 36.39)
    
    GDD(lonlat, 
        day.one = "2019-04-01",
        last.day = "2019-10-01",
        degree.days = 150, 
        return.as = "ndays")
#> Getting climate data from NASA POWER
#> Error in get_power(community = "ag", lonlat = c(129, 36, 132, 39), pars = c("T2M_MAX", : could not find function "get_power"

Created on 2022-08-16 by the reprex package (v2.0.1)

HTTP (422) error using the temperature function

Hi, I was trying out the example code snippet in the JOSS paper:

library(climatrends)
library(sf)
library(nasapower)
# create a polygon within the coordinates 7, 17, 59, 63
e <- matrix(c(7, 59, 17, 59, 17, 63,
              7, 63, 7, 59),
            nrow = 5, ncol = 2, byrow = TRUE)

e <- st_polygon(list(e))
# sample 100 points in the hexagonal type
p <- st_sample(e, 100, type = 'hexagonal')
p <- st_as_sf(p, crs = 4326)
# compute the temperature indices using the random points
temp <- temperature(p, day.one = '2000-01-01', last.day = '2019-12-31',
                    timeseries = TRUE, intervals = 365)

But I'm getting the following error:

Getting climate data from NASA POWER 

Fetching data for 22 regions with 5 x 5 arc-degree 

Error: HTTP (422) - The request was well-formed but was unable to be followed due to semantic errors (WebDAV; RFC 4918)
  Please do not request a time period greater than 366 days.

When I set last.day = '2000-12-31' it works fine, could you address this error or revise the text in the paper?

Get data from large regions when using NASAPOWER

Implement data gathering from large geographic areas.

library("climatrends")

lonlat <- data.frame(lon = c(-4.96, 11.09),
                     lat = c(37.82, 60.80))

# random dates within 2018-05-15 and 2018-05-2
set.seed(321)
dates <- as.integer(runif(2, 17666, 17670))
dates <- as.Date(dates, origin = "1970-01-01")

# get temperature indices for 40 days after day.one
temperature(lonlat,
            day.one = dates,
            span = 40)

Error: 
Please provide correct bounding box values. The bounding box
can only enclose a max of 10 x 10 region of 0.5 degree values
or a 5 x 5 region of 1 degree values, (i.e. 100 points total). 

Acknowledge contributor contributions

As part of JOSS requirements, I noticed that two package contributors listed in the package DESCRIPTION file (Solberg and van Etten) are neither co-authors nor mentioned in the acknowledgements. If contributions don’t warrant authorship, please identify and acknowledge their contributions. openjournals/joss-reviews#4405,

installation of dev version fails

When following the installation in the README

Installing from CRAN works.

However, installing the development version fails - on both Windows and Ubuntu:

remotes::install_github("agrdatasci/climatrends")

I get the following errors:

Downloading GitHub repo agrdatasci/climatrends@HEAD
✓ checking for file ‘/tmp/RtmpPZhckZ/remotes192662211476/AgrDataSci-climatrends-cddf697/DESCRIPTION’ (372ms)
─ preparing ‘climatrends’:
✓ checking DESCRIPTION meta-information ...
─ installing the package to process help pages
-----------------------------------
─ installing source package ‘climatrends’ ...
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in library("nasapower") : there is no package called ‘nasapower’
Error: unable to load R code in package ‘climatrends’
Execution halted
ERROR: lazy loading failed for package ‘climatrends’
─ removing ‘/tmp/RtmpyuDRgM/Rinst197f6af92b2/climatrends’
-----------------------------------
ERROR: package installation failed
Error: Failed to install 'climatrends' from GitHub:
System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E> *** moving datasets to lazyload DB
E> ** inst
E> ** byte-compile and prepare package for lazy loading
E> Error in library("nasapower") : there is no package called ‘nasapower’
E> Error: unable to load R code in package ‘climatrends’
E> Execution halted
E> ERROR: lazy loading failed for package ‘climatrends’
E> * removing ‘/tmp/RtmpyuDRgM/Rinst197f6af92b2/climatrends’
E> -----------------------------------
E> ERROR: package installation failed

missing "Statement of need" section in the manuscript

Dear contributors of the climatrends R package and authors of the JOSS paper,

I'm Istem Fer, I'm one of the reviewers of your paper. I thought I would start with this issue regarding the lack of "Statement of need" section (to be followed by some other format issues). I'll try to keep issues focused and compact so that you can close them one by one as we go. Here we go:

JOSS articles are required to have A Statement of need section (titled as such) that clearly illustrates the research purpose of the software and places it in the context of related work. Please add this section to your pdf accordingly.

add LICENSE.md file with text of MIT license

going through openjournals/joss-reviews#4405 and to pass JOSS requirement "License: Does the repository contain a plain-text LICENSE file with the contents of an OSI approved software license?"

I see that the license is stated in the DESCRIPTION file, but this would help comply with JOSS requirements. For an existing convention to follow, it appears tidyverse packages have a file named LICENSE, like yours, as well as a LICENSE.md file with the license text, and this convention appears to be generated by the usethis::use_mit_license() function

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.