Skip to content

Commit

Permalink
Squashed merge of major changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelHentschel committed Oct 25, 2023
1 parent 4ad26c9 commit b2559d8
Show file tree
Hide file tree
Showing 128 changed files with 8,003 additions and 2,006 deletions.
6 changes: 6 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@
\.sh$
\.tar\.gz$
\.txt$

^temp\.
\.temp$
^vignettes/memoise

^data-raw$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: graphicalExtremes
Title: Statistical Methodology for Graphical Extreme Value Models
Version: 0.2.0
Version: 0.3.0
Maintainer: Sebastian Engelke <[email protected]>
Authors@R:
c(
Expand Down
31 changes: 31 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# Generated by roxygen2: do not edit by hand

export(Gamma2Gamma)
export(Gamma2Sigma)
export(Gamma2Theta)
export(Gamma2chi)
export(Gamma2graph)
export(Sigma2Gamma)
export(Sigma2Sigma)
export(Sigma2Theta)
export(Sigma2graph)
export(Theta2Gamma)
export(Theta2Sigma)
export(Theta2Theta)
export(Theta2graph)
export(checkGamma)
export(checkMatrix)
export(checkSigma)
export(checkSigmaTheta)
export(checkTheta)
export(chi2Gamma)
export(complete_Gamma)
export(complete_Gamma_decomposable)
Expand All @@ -22,19 +33,39 @@ export(emp_vario)
export(emp_vario_pairwise)
export(emst)
export(emtp2)
export(ensure_matrix_symmetry)
export(ensure_matrix_symmetry_and_truncate_zeros)
export(fit_graph_to_Theta)
export(flightCountMatrixToConnectionList)
export(fmpareto_HR_MLE)
export(fmpareto_graph_HR)
export(generate_random_Gamma)
export(generate_random_cactus)
export(generate_random_chordal_graph)
export(generate_random_connected_graph)
export(generate_random_graphical_Gamma)
export(generate_random_integer_Gamma)
export(generate_random_model)
export(generate_random_spd_matrix)
export(generate_random_tree)
export(getDanubeFlowGraph)
export(getFlightDelayData)
export(get_alert_function)
export(get_large_tol)
export(get_mc_cores)
export(get_small_tol)
export(is_valid_Gamma)
export(is_valid_Sigma)
export(is_valid_Theta)
export(loglik_HR)
export(matrix2matrix)
export(partialMatrixToGraph)
export(plotDanube)
export(plotDanubeIGraph)
export(plotFlights)
export(rmpareto)
export(rmpareto_tree)
export(rmstable)
export(rmstable_tree)
export(truncate_zeros)
importFrom(Rdpack,reprompt)
48 changes: 38 additions & 10 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@

#' Get package data
#'
#' Get private data sets from `inst/extdata`.
#'
#' @param filename Base name of the file. E.g. `"FILENAME"` for a file `inst/extdata/FILENAME`.
#' @param isRDS Whether the file is an `.RDS` file.
#'
#' @return
#' If `isRDS=TRUE` an R object.
#' If `isRDS=FALSE` an environment, containing the R objects from the file.
#'
#' @keywords internal
getPackageData <- function(filename, isRDS=TRUE){
# Path of data file
fpath <- system.file('extdata', filename, package='graphicalExtremes')

# RDS files contain a single object which is returned
if(isRDS){
return(readRDS(fpath))
}

# RDA files contain one/multiple R object(s) which are returned in a new environment
env <- new.env(parent = emptyenv())
load(fpath, envir = env)
return(env)
}

#' Upper Danube basin dataset
#'
#' A dataset containing river discharge data for tributaries of the Danube.
Expand All @@ -8,8 +36,8 @@
#' \item{`data_raw`}{A numeric matrix, containing daily (raw) discharge data for each gauging station}
#' \item{`info`}{A data frame, containing information about each gauging station}
#' \item{`flow_edges`}{
#' A two-column numeric matrix. Each row contains the indices (in `info`)
#' of a pair of gauging stations that are directly connected by a river.
#' A two-column numeric matrix. Each row contains the indices (in `info`)
#' of a pair of gauging stations that are directly connected by a river.
#' }
#' }
#'
Expand All @@ -32,7 +60,7 @@
#' \item{`Area`}{Area of the catchment corresponding to the gauging station}
#' \item{`Slope`}{Mean slope of the catchment}
#' \item{`PlotCoordX`, `PlotCoordY`}{
#' X-Y-coordinates which can be used to arrange the gauging stations when plotting a flow graph.
#' X-Y-coordinates which can be used to arrange the gauging stations when plotting a flow graph.
#' }
#' }
#'
Expand All @@ -41,13 +69,13 @@
#' loc <- as.matrix(danube$info[,c('PlotCoordX', 'PlotCoordY')])
#' plot(g, layout = loc)
#'
#' @seealso [`flights`], `vignette('graphicalExtremes')`
#' @family danubeData
#' @family datasets
#'
#' @references
#' \insertAllCited{}
#'
#' @source Bavarian Environmental Agency <https://www.gkd.bayern.de>.
#'
"danube"


Expand All @@ -59,14 +87,14 @@
#' and pre-processed as described in
#' \insertCite{hen2022;textual}{graphicalExtremes}.
#' *Note: The CRAN version of this package contains only data from 2010-2013.*
#' *The full dataset is available in the Github version of this package.*
#' *The full dataset is available in the GitHub version of this package.*
#'
#' @format A named `list` with three entries:
#' \describe{
#' \item{`airports`}{A `data.frame`, containing information about US airports}
#' \item{`delays`}{A numeric matrix, containing daily aggregated delays at the airports in the dataset}
#' \item{`flightCounts`}{
#' A numeric array, containing yearly flight numbers between airports in the dataset
#' A numeric array, containing yearly flight numbers between airports in the dataset
#' }
#' }
#'
Expand Down Expand Up @@ -122,7 +150,8 @@
#' totalDelays <- apply(flights$delays, c(1,2), sum)
#' }
#'
#' @seealso [`danube`], [`flightCountMatrixToConnectionList`], [`plotFlights`]
#' @family flightData
#' @family datasets
#'
#' @source
#' Raw delays data:
Expand All @@ -134,6 +163,5 @@
#' - <https://esubmit.rita.dot.gov/On-Time-Form3A.aspx>
#'
#' Airports (includes license information):
#' - <https://openflights.org/data.html>
#'
#' - <https://openflights.org/data>
"flights"
Loading

0 comments on commit b2559d8

Please sign in to comment.