From dd224c67ca3492ce17345601a9a220ef2137925b Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Thu, 21 Nov 2024 12:04:57 -0800 Subject: [PATCH 1/9] tidy readme --- README.Rmd | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.Rmd b/README.Rmd index 9146406..2566ffc 100644 --- a/README.Rmd +++ b/README.Rmd @@ -43,7 +43,7 @@ The [R](https://www.r-project.org/) package **mlms** is used to store and proces Many investigations have assessed the geology and hydrology of the ESRP aquifer at and near the INL, with a comprehensive listing of USGS Idaho National Laboratory Project Office ([INLPO]) publications available [online]. Fisher and Twining (2011) documented the use of Multilevel Monitoring Systems to examine hydraulic head and temperature in six wells from 2007--2008. Subsequent expansions included nine wells (Twining and Fisher, 2012), 11 wells (Twining and Fisher, 2015), and 12 wells (Twining and others, 2021). -Various studies have documented water chemistry at different depths in the ESRP aquifer, with summaries of water-quality data collected from 2005--2008 provided by Bartholomay and Twining (2010), 2009--2011 provided by Davis and others (2013), 2009--2013 provided by Bartholomay and others (2015), 2012--2015 provided by Bartholomay and others (2017), and 2014--2018 provided by Twining and others (2021). A tracer study by Bartholomay and others (2013) examined whether drilling fluids could remain in the MLMS wells and found that the tracer moved out of the formation for most of the zones analyzed. +Various studies have documented water chemistry at different depths in the ESRP aquifer, with summaries of water-quality data collected from 2005--2008 provided by Bartholomay and Twining (2010), 2009--2011 provided by Davis and others (2013), 2009--2013 provided by Bartholomay and others (2015), 2012--2015 provided by Bartholomay and others (2017), and 2014--2018 provided by Twining and others (2021). A tracer study by Bartholomay and others (2013) examined whether drilling fluids could remain in the MLMS wells and found that the tracer moved out of the formation for most of the monitoring zones analyzed. <p> <figure class="figure"> diff --git a/README.md b/README.md index c0ce8a4..a068029 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ by Davis and others (2013), 2009–2013 provided by Bartholomay and others 2014–2018 provided by Twining and others (2021). A tracer study by Bartholomay and others (2013) examined whether drilling fluids could remain in the MLMS wells and found that the tracer moved out of the -formation for most of the zones analyzed. +formation for most of the monitoring zones analyzed. <p> <figure class="figure"> -- GitLab From 116c11e4ccfc11050a53b0e0e379be184c7c1ec4 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Thu, 21 Nov 2024 12:47:53 -0800 Subject: [PATCH 2/9] remove need for token in install instructions --- README.Rmd | 3 +-- README.md | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.Rmd b/README.Rmd index 2566ffc..0737d0d 100644 --- a/README.Rmd +++ b/README.Rmd @@ -68,12 +68,11 @@ To install the package along with its dependencies, which are required to run ex install.packages("mlms", dependencies = TRUE) ``` -To install the development version of the package, you can either clone the repository and build it from source, or run the following commands. Make sure the **remotes** package for R is installed, and set an environment variable named `GITLAB_PAT` with your USGS GitLab personal access token. +To install the development version of the package, you can either clone the repository and build it from source, or run the following commands. Make sure the **remotes** package for R is installed. ```r remotes::install_gitlab( repo = "inl/mlms@develop", - auth_token = Sys.getenv("GITLAB_PAT"), host = "code.usgs.gov", dependencies = TRUE ) diff --git a/README.md b/README.md index a068029..47ae2e7 100644 --- a/README.md +++ b/README.md @@ -76,14 +76,11 @@ install.packages("mlms", dependencies = TRUE) To install the development version of the package, you can either clone the repository and build it from source, or run the following commands. -Make sure the **remotes** package for R is installed, and set an -environment variable named `GITLAB_PAT` with your USGS GitLab personal -access token. +Make sure the **remotes** package for R is installed. ``` r remotes::install_gitlab( repo = "inl/mlms@develop", - auth_token = Sys.getenv("GITLAB_PAT"), host = "code.usgs.gov", dependencies = TRUE ) -- GitLab From 155974505d2bff672268a1eeff9daf0fc04739b3 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Thu, 21 Nov 2024 20:53:51 -0800 Subject: [PATCH 3/9] add url to DESCRIPTION and wrap eqns. --- DESCRIPTION | 2 +- man/mlms-package.Rd | 1 + vignettes/methods.Rmd | 11 +++++++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0b0185c..5a809c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -69,7 +69,7 @@ Copyright: This software is in the public domain because it contains materials Encoding: UTF-8 LazyData: true LazyDataCompression: xz -URL: https://code.usgs.gov/inl/mlms +URL: https://rconnect.usgs.gov/INLPO/mlms-main/, https://code.usgs.gov/inl/mlms BugReports: https://code.usgs.gov/inl/mlms/-/issues Roxygen: list(markdown = TRUE) RoxygenNote: 7.3.2 diff --git a/man/mlms-package.Rd b/man/mlms-package.Rd index 6095eaa..3c7bedd 100644 --- a/man/mlms-package.Rd +++ b/man/mlms-package.Rd @@ -11,6 +11,7 @@ Analysis-ready datasets detailing the Multilevel Monitoring System (MLMS) wells \seealso{ Useful links: \itemize{ + \item \url{https://rconnect.usgs.gov/INLPO/mlms-main/} \item \url{https://code.usgs.gov/inl/mlms} \item Report bugs at \url{https://code.usgs.gov/inl/mlms/-/issues} } diff --git a/vignettes/methods.Rmd b/vignettes/methods.Rmd index bcc5788..39a064a 100644 --- a/vignettes/methods.Rmd +++ b/vignettes/methods.Rmd @@ -26,7 +26,8 @@ Fluid pressure and temperature were measured using a pressure transducer, which Data on fluid pressure and temperature are transmitted to the land surface via a wireline communication cable, processed using a data acquisition system, and recorded on a datalogger. Simultaneously, atmospheric pressure is measured and recorded at the land surface using a handheld barometric sensor. The hydraulic head at each measurement port is then calculated using the fluid pressure, fluid temperature, and atmospheric pressure measurements. Assuming 100 percent barometric efficiency, hydraulic head is expressed as $$ -h_i = Z - D_i + \Psi( P_{out,i,t}, T_{i,t}, P_{atm,t} ) \quad \text{for} \, i \in \{1, 2, \ldots, n\} \, \text{and} \, t = t_i \text{.} {\tag{1}} +h_i = Z - D_i + \Psi( P_{out,i,t}, T_{i,t}, P_{atm,t} ) \\ +\text{for} \, i \in \{1, 2, \ldots, n\} \, \text{and} \, t = t_i \text{.} {\tag{1}} $$ Where @@ -104,7 +105,7 @@ Where The specific weight of water ($\gamma_w$ in eq. 2) was calculated solely as a function of temperature (McCutcheon and others, 1993), assuming negligible salinity and gravitational differences between measurements, and expressed as $$ -\gamma_w(T) = 62.43 \times \left[ 1 - \left( \left[ \frac{T + 288.94}{508929 \times (T + 68.13)} \right] \times (T - 3.99)^2 \right) \right] \text{.} {\tag{3}} +\gamma_w(T) = 62.43 \times \left[ 1 - \left( \frac{T + 288.94}{508929 \times (T + 68.13)} \times (T - 3.99)^2 \right) \right] \text{.} {\tag{3}} $$ @@ -121,7 +122,8 @@ After recording fluid pressure and temperature measurements, the transducer was The multilevel completion of a borehole is characterized by: the measured depth to the pressure transducer at a port coupling ($D_i$ in eq. 1), and the dimensions of MLMS components documented in the MLMS installation log. The depth to the transducer plane is calculated by adding the water level depth to the pressure head measured inside the multiport casing, and is expressed as follows: $$ -D_i = L( \ell_{e,t} ) + \Psi( P_{in,i,t}, T_{i,t}, P_{atm,t} ) \quad \text{for} \, i \in \{1, 2, \ldots, n\} \, \text{and} \, t = t_i \text{.} {\tag{4}} +D_i = L( \ell_{e,t} ) + \Psi( P_{in,i,t}, T_{i,t}, P_{atm,t} ) \\ +\text{for} \, i \in \{1, 2, \ldots, n\} \, \text{and} \, t = t_i \text{.} {\tag{4}} $$ Where @@ -205,7 +207,8 @@ Simultaneous measurements of $P_{in}$, $T$, $P_{atm}$ (eq. 4), and $\ell_e$ (eqs The location of MLMS components in a borehole are determined by the measured depth to the pressure transducer plane at a port coupling ($D_i$ in eq. 4) and its position within the MLMS installation log. For example, the depth to the top of each monitoring zone is determined by subtracting the distance between the transducer plane and the bottom of the adjacent upper packer from the depth to the transducer plane, or $$ -D_{top,z} = D_i - a_i \quad \text{for} \, z \in \{1, 2, \ldots, m\} \, \text{ and } \, i \in \{1, 2, \ldots, n\} \setminus E \text{.} {\tag{6}} +D_{top,z} = D_i - a_i \\ +\text{for} \, z \in \{1, 2, \ldots, m\} \, \text{ and } \, i \in \{1, 2, \ldots, n\} \setminus E \text{.} {\tag{6}} $$ Where -- GitLab From 921da2bb873d7a69ef913f15add735239329fb08 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 10:56:49 -0800 Subject: [PATCH 4/9] set style max-width for svg --- vignettes/MIDDLE-2050A.Rmd | 2 +- vignettes/MIDDLE-2051.Rmd | 2 +- vignettes/USGS-103.Rmd | 2 +- vignettes/USGS-105.Rmd | 2 +- vignettes/USGS-108.Rmd | 2 +- vignettes/USGS-131A.Rmd | 2 +- vignettes/USGS-132.Rmd | 2 +- vignettes/USGS-133.Rmd | 2 +- vignettes/USGS-134.Rmd | 2 +- vignettes/USGS-135.Rmd | 2 +- vignettes/USGS-137A.Rmd | 2 +- vignettes/USGS-149.Rmd | 2 +- vignettes/erd.Rmd | 2 +- vignettes/methods.Rmd | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/vignettes/MIDDLE-2050A.Rmd b/vignettes/MIDDLE-2050A.Rmd index 3736ac3..93a45c2 100644 --- a/vignettes/MIDDLE-2050A.Rmd +++ b/vignettes/MIDDLE-2050A.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for MIDDLE-2050A well, Idaho National La <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/MIDDLE-2050A.svg" alt="MIDDLE 2050A" width="55%" /> + <img src="../man/figures/MIDDLE-2050A.svg" class="figure-img img-fluid" alt="MIDDLE 2050A" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/MIDDLE-2051.Rmd b/vignettes/MIDDLE-2051.Rmd index 9f06d18..a3ede6c 100644 --- a/vignettes/MIDDLE-2051.Rmd +++ b/vignettes/MIDDLE-2051.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for MIDDLE-2051 well, Idaho National Lab <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/MIDDLE-2051.svg" alt="MIDDLE 2051" width="55%" /> + <img src="../man/figures/MIDDLE-2051.svg" class="figure-img img-fluid" alt="MIDDLE 2051" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-103.Rmd b/vignettes/USGS-103.Rmd index 461d9dc..92b5e05 100644 --- a/vignettes/USGS-103.Rmd +++ b/vignettes/USGS-103.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-103 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-103.svg" alt="USGS 103" width="55%" /> + <img src="../man/figures/USGS-103.svg" class="figure-img img-fluid" alt="USGS 103" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-105.Rmd b/vignettes/USGS-105.Rmd index c891d10..620cc96 100644 --- a/vignettes/USGS-105.Rmd +++ b/vignettes/USGS-105.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-105 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-105.svg" alt="USGS 105" width="55%" /> + <img src="../man/figures/USGS-105.svg" class="figure-img img-fluid" alt="USGS 105" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-108.Rmd b/vignettes/USGS-108.Rmd index af310b6..ae3ba61 100644 --- a/vignettes/USGS-108.Rmd +++ b/vignettes/USGS-108.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-108 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-108.svg" alt="USGS 108" width="55%" /> + <img src="../man/figures/USGS-108.svg" class="figure-img img-fluid" alt="USGS 108" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-131A.Rmd b/vignettes/USGS-131A.Rmd index bf5cb72..137bc04 100644 --- a/vignettes/USGS-131A.Rmd +++ b/vignettes/USGS-131A.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-131A well, Idaho National Labor <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-131A.svg" alt="USGS 131A" width="55%" /> + <img src="../man/figures/USGS-131A.svg" class="figure-img img-fluid" alt="USGS 131A" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-132.Rmd b/vignettes/USGS-132.Rmd index 65cb4d0..c77fc9e 100644 --- a/vignettes/USGS-132.Rmd +++ b/vignettes/USGS-132.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-132 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-132.svg" alt="USGS 132" width="55%" /> + <img src="../man/figures/USGS-132.svg" class="figure-img img-fluid" alt="USGS 132" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-133.Rmd b/vignettes/USGS-133.Rmd index 55b6c45..f14dd57 100644 --- a/vignettes/USGS-133.Rmd +++ b/vignettes/USGS-133.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-133 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-133.svg" alt="USGS 133" width="55%" /> + <img src="../man/figures/USGS-133.svg" class="figure-img img-fluid" alt="USGS 133" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-134.Rmd b/vignettes/USGS-134.Rmd index 560c786..1d4d264 100644 --- a/vignettes/USGS-134.Rmd +++ b/vignettes/USGS-134.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-134 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-134.svg" alt="USGS 134" width="55%" /> + <img src="../man/figures/USGS-134.svg" class="figure-img img-fluid"alt="USGS 134" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-135.Rmd b/vignettes/USGS-135.Rmd index 372a3d0..4c12e7d 100644 --- a/vignettes/USGS-135.Rmd +++ b/vignettes/USGS-135.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-135 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-135.svg" alt="USGS 135" width="55%" /> + <img src="../man/figures/USGS-135.svg" class="figure-img img-fluid" alt="USGS 135" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-137A.Rmd b/vignettes/USGS-137A.Rmd index 818bc74..e641bd1 100644 --- a/vignettes/USGS-137A.Rmd +++ b/vignettes/USGS-137A.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-137A well, Idaho National Labor <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-137A.svg" alt="USGS 137A" width="55%" /> + <img src="../man/figures/USGS-137A.svg" class="figure-img img-fluid" alt="USGS 137A" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/USGS-149.Rmd b/vignettes/USGS-149.Rmd index d865cd7..c829421 100644 --- a/vignettes/USGS-149.Rmd +++ b/vignettes/USGS-149.Rmd @@ -6,7 +6,7 @@ Lithology log and multilevel completion for USGS-149 well, Idaho National Labora <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/USGS-149.svg" alt="USGS 149" width="55%" /> + <img src="../man/figures/USGS-149.svg" class="figure-img img-fluid" alt="USGS 149" style="max-width: 430px;" /> </figure> </p> diff --git a/vignettes/erd.Rmd b/vignettes/erd.Rmd index 80deaf4..31adf13 100644 --- a/vignettes/erd.Rmd +++ b/vignettes/erd.Rmd @@ -6,7 +6,7 @@ The Entity Relationship Diagram (ERD) for the mlms package datasets illustrates <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/erd.svg" alt="erd" width="80%" /> + <img src="../man/figures/erd.svg" class="figure-img img-fluid" alt="erd" style="max-width: 860px;" /> </figure> </p> diff --git a/vignettes/methods.Rmd b/vignettes/methods.Rmd index 39a064a..031d7fe 100644 --- a/vignettes/methods.Rmd +++ b/vignettes/methods.Rmd @@ -11,7 +11,7 @@ Two versions of the Westbay™ System were employed in this study: the MP55 <p> <figure class="figure"> - <img class="figure-img img-fluid" src="../man/figures/methods.svg" alt="methods" width="100%" /> + <img src="../man/figures/methods.svg" class="figure-img img-fluid" alt="methods" style="max-width: 860px;" /> <figcaption class="figure-caption"> <b>Figure 1.</b> Terms used in the calculation of hydraulic head based on the portable probe position when coupled with a measurement port in the multilevel monitoring system (Modified from Westbay™, written commun., 2009). </figcaption> -- GitLab From d02032d2ed3f48339b4793a441beafae24786607 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 11:12:32 -0800 Subject: [PATCH 5/9] update news --- NEWS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 6b6ea95..3382b97 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # mlms (development version) -- ... +- Implemented a maximum width restriction for SVG images on the package website to + ensure consistent display and prevent oversized visuals. # mlms 1.0.2 -- GitLab From a7c7ba609f1bf1ce95040ee5d3b72d569d73e703 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 12:15:26 -0800 Subject: [PATCH 6/9] add Download vignette --- .gitignore | 1 + pkgdown/_pkgdown.yml | 8 ++- vignettes/download.Rmd | 157 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 vignettes/download.Rmd diff --git a/.gitignore b/.gitignore index 41cfcf5..cdbb25f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ mlms.Rproj /docs renv.lock /data-raw/output.log +/vignettes/download_files diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index b2488fb..dc09798 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -23,7 +23,9 @@ navbar: href: articles/statistics.html - text: Entity Relationship Diagram href: articles/erd.html - - text: Completions + - text: Methods + href: articles/methods.html + - text: Completion menu: - text: MIDDLE 2050A href: articles/MIDDLE-2050A.html @@ -49,8 +51,8 @@ navbar: href: articles/USGS-137A.html - text: USGS 149 href: articles/USGS-149.html - - text: Methods - href: articles/methods.html + - text: Download + href: articles/download.html - text: Changelog href: news/index.html right: diff --git a/vignettes/download.Rmd b/vignettes/download.Rmd new file mode 100644 index 0000000..550637c --- /dev/null +++ b/vignettes/download.Rmd @@ -0,0 +1,157 @@ +--- +title: "Download" +resource_files: + - download_files +--- + +The **mlms** package offers a comprehensive collection of datasets in various formats. Users may download individual files for specific data needs, or all datasets in a compressed ZIP file for efficiency. These datasets can be easily imported into data analysis software or programming languages for further analysis. + +```{r include=FALSE} + +pkg <- "mlms" +destdir <- "download_files" +paste0(destdir, "/*") |> unlink() + +files <- inldata::write_datasets( + package = pkg, + destdir = destdir, + gzip = c("json", "geojson"), + pretty = FALSE +) |> basename() +exts <- inldata::get_file_ext(files) +fmts <- exts |> unique() |> sort() +paths <- lapply(fmts, + FUN = function(x) { + paste(destdir, files[exts %in% x], sep = "/") + } +) +names(paths) <- fmts + +cols <- rbind( + c( + "csv", + "CSV", + "Text-based format storing tabular data, commonly used for data exchange due to its simplicity." + ), + c( + "xlsx", + "Spreadsheet", + "A Microsoft Excel file, part of the Office Open XML standard, used for storing and processing tabular data." + ), + c( + "parquet", + "Parquet", + "An Arrow Parquet file, used for efficient storage and high-speed processing of big data." + ), + c( + "json.gz", + "JSON", + paste( + "A text-based format compressed using Gzip.", + "Widely used for system interoperability due to its readability." + ) + ), + c( + "geojson.gz", + "GeoJSON", + paste( + "A text-based format compressed using Gzip.", + "Used for encoding geographic features and their nonspatial attributes." + ) + ), + c( + "zip", + "Shapefile", + paste( + "A compressed (ZIP format) file serving as a container for storing geographical features", + "and their associated attributes, optimizing transfer efficiency." + ) + ) +) |> + as.data.frame() +colnames(cols) <- c("ext", "header", "title") +cols <- cols[cols$ext %in% exts, ] + +paths <- paths[cols$ext] +rows <- unlist(paths) |> + basename() |> + tools::file_path_sans_ext(compression = TRUE) |> + unique() + +m <- matrix( + nrow = length(rows), + ncol = nrow(cols), + dimnames = list(rows, cols$ext) +) + +hrefs <- unlist(paths) |> + as.character() +sizes <- inldata::get_file_size(hrefs) +titles <- sprintf("%s (%s)", basename(hrefs), sizes) +icon <- fontawesome::fa( + name = "file", + fill = "steelblue", + prefer_type = "solid" +) +data <- sprintf( + fmt = "<a href='%s' title='%s' target='_blank'>%s</a>", + hrefs, titles, icon +) + +i <- basename(hrefs) |> + tools::file_path_sans_ext(compression = TRUE) |> + match(rownames(m)) +j <- inldata::get_file_ext(hrefs) |> + match(colnames(m)) +m[cbind(i, j)] <- data +tbl <- m + +m <- utils::data(package = pkg)$results +titles <- m[, "Title"] +names(titles) <- m[, "Item"] +titles <- titles[rownames(tbl)] + +ds_nm <- sprintf( + fmt = "<a href='../reference/%s.html' title='%s'>%s</a>", + rownames(tbl), titles, rownames(tbl) +) +tbl <- cbind(ds_nm, tbl) +rownames(tbl) <- NULL + +headers <- c("Dataset", cols$header) +titles <- c("Name of the package dataset.", cols$title) +col_names <- sprintf( + fmt = "<span title='%s'>%s</span>", + titles, headers +) + +ver <- utils::packageVersion(pkg = pkg) |> format() +archive <- sprintf("%s/%s-datasets-v%s.zip", destdir, pkg, ver) +checkmate::assert_path_for_output(archive, overwrite = TRUE) +archive::archive_write_dir(archive, dir = destdir, format = "zip") +archive_size <- inldata::get_file_size(archive) + +``` + +```{r echo=FALSE, results="asis"} + +options(knitr.kable.NA = '-') +knitr::kable(tbl, row.names = FALSE, col.names = col_names) + +``` + +```{r echo=FALSE, results="asis"} + +fontawesome::fa("download") |> + htmltools::tagList( + sprintf("Download all (%s)", archive_size) + ) |> + htmltools::a( + href = archive, + target = "_blank", + title = "Download a unified ZIP file that contains all compressed files.", + ) |> + htmltools::tagList() |> + htmltools::p() + +``` -- GitLab From e2db7b8b927f54b65da4c53fcc2748c7507ff234 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 12:19:23 -0800 Subject: [PATCH 7/9] update news --- NEWS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3382b97..646a0fd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ # mlms (development version) -- Implemented a maximum width restriction for SVG images on the package website to +- Add a new vignette titled "Download", + providing users with the ability to download datasets in multiple formats. +- Implement a maximum width restriction for SVG images on the package website to ensure consistent display and prevent oversized visuals. # mlms 1.0.2 -- GitLab From 7e3b965438b1557a65b3617c416df8e3313e4c11 Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 12:54:27 -0800 Subject: [PATCH 8/9] make download vignette more general --- vignettes/download.Rmd | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/vignettes/download.Rmd b/vignettes/download.Rmd index 550637c..01d74c5 100644 --- a/vignettes/download.Rmd +++ b/vignettes/download.Rmd @@ -28,6 +28,11 @@ paths <- lapply(fmts, names(paths) <- fmts cols <- rbind( + c( + "txt", + "Text", + "Text-based format." + ), c( "csv", "CSV", @@ -66,6 +71,14 @@ cols <- rbind( "A compressed (ZIP format) file serving as a container for storing geographical features", "and their associated attributes, optimizing transfer efficiency." ) + ), + c( + "tiff", + "GeoTIFF", + paste( + "A standard TIFF (Tagged Image File Format) with embedded geospatial metadata", + "allowing geographic information to be associated with the image data." + ) ) ) |> as.data.frame() -- GitLab From 4e35961bd5634448ce8e95267d5551b6f07b754d Mon Sep 17 00:00:00 2001 From: Jason Fisher <jfisher@usgs.gov> Date: Sat, 23 Nov 2024 18:06:36 -0800 Subject: [PATCH 9/9] add missing packages --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5a809c6..c4ccbf0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -39,6 +39,7 @@ Imports: tools, utils Suggests: + arrow, connectapi, covr, dm, @@ -59,7 +60,8 @@ Suggests: roxygen2, tinytest, V8, - webmap + webmap, + writexl License: CC0 Copyright: This software is in the public domain because it contains materials that originally came from the United States Geological Survey (USGS), an -- GitLab