Skip to content

load CRUCL data - #132

Open
vullioud wants to merge 37 commits into
courtiol:mainfrom
vullioud:#118
Open

load CRUCL data#132
vullioud wants to merge 37 commits into
courtiol:mainfrom
vullioud:#118

Conversation

@vullioud

@vullioud vullioud commented Dec 3, 2020

Copy link
Copy Markdown
Collaborator

a function to load CRUCL data. Return the extended dataset and a list of raster

Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated

## need different way for rasterlayer and raster brick
data_points <- lapply(raster, function(x) {
if(raster::nlayers(x) < 2) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Test using elv name instead

Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated

## Second if one value per cell per month
} else if (split_by == "month") {
layer <- data$month

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Probably not needed, use data$month instead

Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
Comment thread load_data.R Outdated
vullioud and others added 18 commits December 10, 2020 08:39
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Simplify code

Co-authored-by: Alexandre Courtiol <alexandre.courtiol@gmail.com>
Comment thread IsoriX/R/prepsources.R
#' GNIPDataDEagg <- prepsources(data = GNIPDataDE)
#' ## Create a processed dataset for Germany with tmp and dtr
#' GNIPDataDEagg <- prepsources(data = GNIPDataDE,
#' data_needed = list(tmp =TRUE, dtr = TRUE))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
#' data_needed = list(tmp =TRUE, dtr = TRUE))
#' data_needed = list(tmp = TRUE, dtr = TRUE))

Comment thread IsoriX/R/prepsources.R
#' GNIPDataDEyearly <- prepsources(data = GNIPDataDE,
#' split_by = "year")
#' split_by = "year",
#' data_needed = list(tmp =TRUE, dtr = TRUE))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
#' data_needed = list(tmp =TRUE, dtr = TRUE))
#' data_needed = list(tmp = TRUE, dtr = TRUE))

Comment thread IsoriX/R/prepsources.R
#' month = 5:8,
#' year = 1995:1996)
#' year = 1995:1996,
#' data_needed = list(tmp =TRUE, dtr = TRUE))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
#' data_needed = list(tmp =TRUE, dtr = TRUE))
#' data_needed = list(tmp = TRUE, dtr = TRUE))

Comment thread IsoriX/R/prepsources.R
#' prop_random = 0.9,
#' random_level = "obs")
#' random_level = "obs",
#' data_needed = list(tmp =TRUE, dtr = TRUE))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
#' data_needed = list(tmp =TRUE, dtr = TRUE))
#' data_needed = list(tmp = TRUE, dtr = TRUE))

Comment thread IsoriX/R/prepsources.R
#' prop_random = 0.5,
#' random_level = "source")
#' random_level = "source",
#' data_needed = list(tmp =TRUE, dtr = TRUE))

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Suggested change
#' data_needed = list(tmp =TRUE, dtr = TRUE))
#' data_needed = list(tmp = TRUE, dtr = TRUE))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants