Skip to content

Commit

Permalink
Adding first draft of paper.md for JOSS
Browse files Browse the repository at this point in the history
  • Loading branch information
hanecakr committed Nov 19, 2023
1 parent e9b5196 commit 70b6bd5
Show file tree
Hide file tree
Showing 40 changed files with 3,706 additions and 200 deletions.
2 changes: 1 addition & 1 deletion .Rproj.user/429CC01A/pcs/files-pane.pper
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ascending": false
}
],
"path": "C:/Users/hanecakr/Documents/R_github/fellingdateR"
"path": "C:/Users/hanecakr/Documents/R_github/fellingdateR/inst/paper"
}
12 changes: 6 additions & 6 deletions .Rproj.user/429CC01A/pcs/windowlayoutstate.pper
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"left": {
"splitterpos": 216,
"splitterpos": 267,
"topwindowstate": "NORMAL",
"panelheight": 830,
"windowheight": 868
"panelheight": 1070,
"windowheight": 1107
},
"right": {
"splitterpos": 221,
"splitterpos": 284,
"topwindowstate": "NORMAL",
"panelheight": 830,
"windowheight": 868
"panelheight": 1070,
"windowheight": 1107
}
}
4 changes: 0 additions & 4 deletions .Rproj.user/429CC01A/rmd-outputs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
C:/Users/hanecakr/AppData/Local/Temp/Rtmpyi37iu/preview-a0c20363b9.html
C:/Users/hanecakr/AppData/Local/Temp/Rtmpyi37iu/preview-234824286f5b.html
C:/Users/hanecakr/AppData/Local/Temp/Rtmpkvmuwl/preview-2ec83a8f2a35.html
C:/Users/hanecakr/AppData/Local/Temp/Rtmpkvmuwl/preview-4d3452916d08.html



Expand Down
13 changes: 8 additions & 5 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Package: fellingdateR
Title: `fellingdateR` is an R package that aims to facilitate the organisation,
analysis and interpretation of tree-ring data from wooden heritage objects
and structures
Title: Estimate, report and combine felling dates from historical tree-ring
series
Version: 0.0.0.9003
Authors@R: c(
person("Kristof", "Haneca", , "[email protected]",role = c("aut", "cre"),
Expand All @@ -12,8 +11,12 @@ Authors@R: c(
comment = c(ORCID = "0000-0001-6966-1729"))
)
Description: `fellingdateR` is an R package that aims to facilitate the
organization, analysis and interpretation of tree-ring data from wooden
cultural heritage objects and structures.
analysis and interpretation of tree-ring data from wooden
cultural heritage objects and structures. The package aims to facilitate and
standardize the reporting, interpretation and combination of felling date
estimates.
URL: https://github.com/hanecakr/fellingdateR
BugReports: https://github.com/hanecakr/fellingdateR/issues
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
8 changes: 8 additions & 0 deletions R/cor_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
#' - t_St: Student's t-value
#' - t_BP: t-values according to the Baillie & Pilcher (1973) algorithm
#' - t_Ho: t-values according to the Hollstein (1980) algorithm
#' @examples
#' # example code
#'
#' Doel1 <- system.file("extdata", "DOEL1.fh", package = "fellingdateR")
#' Doel1_trs <- read_fh(Doel1, verbose = FALSE)
#' # crossdating ring-width series from Doel 1 against each other:
#'
#' cor_results <- cor_table(Doel1_trs, output = "table", min_overlap = 80)
#'
cor_table <-
function(x,
Expand Down
4 changes: 4 additions & 0 deletions R/get_header.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
#' `rwl`.
#'
#' @return A `data.frame` with 29 header fields.
#' @examples
#' Doel1 <- system.file("extdata", "DOEL1.fh", package = "fellingdateR")
#' Doel1_trs <- read_fh(Doel1, verbose = FALSE)
#' get_header(Doel1_trs)
#'
#' @export

Expand Down
4 changes: 4 additions & 0 deletions R/movAv.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#'
#' @return A `numeric` vector of the same length of `x` with the computed
#' running mean values.
#' @examples
#' num_vec <- rnorm(100)
#' movAv(num_vec, w = 20)
#'
#' @export

movAv <- function(x,
Expand Down
4 changes: 4 additions & 0 deletions R/sw_combine_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

#' @return A ggplot-style graph.
#' @export
#' @examples
#' fellingdateR:::dummy2
#' combo <- sw_combine(fellingdateR:::dummy2)
#' sw_combine_plot(combo)
#'
#'
sw_combine_plot <- function(x) {
Expand Down
17 changes: 17 additions & 0 deletions R/sw_interval.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@
#' * If `TRUE`, a ggplot-style graph is returned of the individual
#' sapwood model and estimate of the felling date range.
#' * If `FALSE`, a list with the numeric output of the modelling process is returned.
#' @examples
#' # 10 sapwood rings observed and the Wazny 1990 sapwood model:
#' sw_interval(n_sapwood = 10,
#' last = 1234,
#' hdi = TRUE,
#' credMass = .95,
#' sw_data = "Wazny_1990",
#' densfun = "lognormal",
#' plot = FALSE)
#' # same example as above, but with numerical output (hdi = FALSE):
#' sw_interval(n_sapwood = 10,
#' last = 1234,
#' hdi = FALSE,
#' credMass = .95,
#' sw_data = "Wazny_1990",
#' densfun = "lognormal",
#' plot = FALSE)
#'
#' @export
#'
Expand Down
10 changes: 10 additions & 0 deletions R/sw_interval_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
#' @param x Output of [sw_interval()].
#'
#' @return A ggplot-style graph.
#' @examples
#' tmp <- sw_interval(n_sapwood = 10,
#' last = 1000,
#' hdi = FALSE,
#' credMass = .95,
#' sw_data = "Hollstein_1980",
#' densfun = "lognormal",
#' plot = FALSE)
#' sw_interval_plot(tmp)
#'
#' @export
#'
sw_interval_plot <- function(x) {
Expand Down
4 changes: 4 additions & 0 deletions R/sw_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#' process is returned.
#'
#' @export
#' @examples
#' sw_model("Sohar_2012_ELL_c")
#'
#' sw_model("Hollstein_1980")
#'
sw_model <-
function(sw_data = "Hollstein_1980",
Expand Down
14 changes: 10 additions & 4 deletions R/sw_sum_plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
#' @param x The output of `sw_sum()`.
#' @param bar_col The fill color for the bars.
#' @param spline_col The line color of the fitted smoothing spline.
#' @param dot_col The color of the dots that represent exact felling dates.
#' @param dot_col The color of the shapes that represent exact felling dates.
#' @param dot_size A size argument for the shapes that represent exact felling dates.
#' @param dot_shape Number corresponding to the point symbol available in R for the shapes that represent exact felling dates.
#'
#' @return A ggplot style graph.
#' @export
Expand All @@ -21,7 +23,9 @@
sw_sum_plot <- function(x,
bar_col = "steelblue",
spline_col = "red3",
dot_col = "steelblue4") {
dot_col = "steelblue4",
dot_size = 2,
dot_shape = 21) {

# to avoid notes in CMD check
spline <- SPD_wk <- year <- y <- SPD <- SPD_movAv <- NULL
Expand Down Expand Up @@ -75,8 +79,10 @@ p <-
na.rm = T) +
{ if (nrow(fd) > 0) ggplot2::geom_point(data = fd,
ggplot2::aes(x = year, y = SPD + y * p_max/20),
size = 2,
colour = dot_col,
size = dot_size,
fill = dot_col,
color = dot_col,
shape = dot_shape,
na.rm = T) } +
ggplot2::scale_x_continuous(
limits = c(plyr::round_any(plot_range[1], 10, floor),
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
Loading

0 comments on commit 70b6bd5

Please sign in to comment.