Commit 9dbaa7e2 authored by Chris Holbrook's avatar Chris Holbrook

quiet status bar in crw_in_polygon and reorgnaize vignette workflow

parent c7eec6e5
......@@ -2,7 +2,7 @@ Package: glatos
Type: Package
Title: A package for the Great Lakes Acoustic Telemetry Observation System
Description: Functions useful to members of the Great Lakes Acoustic Telemetry Observation System www.glatos.glos.us; many more broadly relevant to simulating, processing, analysing, and visualizing acoustic telemetry data.
Version: 0.3.0.9008
Version: 0.3.0.9009
Date: 2019-02-22
Depends: R (>= 3.2.0)
Imports:
......
......@@ -31,6 +31,9 @@
#' @param sp_out Logical. If TRUE (default) then output is a
#' \link[sp]{SpatialPoints} object. If FALSE, then output is a
#' data.frame.
#'
#' @param show_progress Logical. Progress bar and status messages will be
#' shown if TRUE (default) and not shown if FALSE.
#'
#' @details If initPos = NA, then a starting point is randomly
#' selected within the polygon boundary. A path is simulated forward
......@@ -100,7 +103,7 @@
crw_in_polygon <- function(polyg, theta = c(0,10), stepLen = 100,
initPos = c(NA,NA), initHeading = NA, nsteps = 30,
EPSG = 3175, sp_out = TRUE){
EPSG = 3175, sp_out = TRUE, show_progress = TRUE){
#convert to Polygon if not already
if(!inherits(polyg, c("SpatialPolygonsDataFrame", "SpatialPolygons",
......@@ -174,8 +177,10 @@ crw_in_polygon <- function(polyg, theta = c(0,10), stepLen = 100,
k <- 0
#initialize progress bar
message("Simulating tracks...")
pb <- txtProgressBar(min = 0, max = nsteps, initial = 0, style = 3)
if(show_progress) {
message("Simulating tracks...")
pb <- txtProgressBar(min = 0, max = nsteps, initial = 0, style = 3)
}
while(max(rows_i) <= (nsteps + 1)){
......@@ -226,11 +231,13 @@ crw_in_polygon <- function(polyg, theta = c(0,10), stepLen = 100,
#update progress bar
setTxtProgressBar(pb, max(rows_i))
if(max(rows_i) > (nsteps + 1)) close(pb)
if(show_progress){
setTxtProgressBar(pb, max(rows_i))
if(max(rows_i) > (nsteps + 1)) close(pb)
}
} #end while
message("Done.")
if(show_progress) message("Done.")
#convert to input coordinate system
......
library(rmarkdown)
library(tint)
render(input = "inst/user_guides/data_requirements.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/user_guides/data_loading.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/user_guides/receiver_efficiency.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/user_guides/residence_index.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/user_guides/detection_range_vignette.Rmd",
output_file = "detection_range_vignette.pdf",
output_format = tint::tintPdf(highlight = "haddock"))
render(input = "inst/user_guides/gganimate_vignette.Rmd",
output_file = "gganimate.pdf",
output_format = tint::tintPdf(highlight = "haddock"), clean=TRUE)
---
title: "Assessing acoustic tag and receiver performance: An approach for visualizing and analyzing passive detection range studies in R"
subtitle: "Workshop Handout - GLATOS, March 27, 2018"
author: "Todd Hayden, Christopher Holbrook, Tom Binder, Mike Lowe"
date: "`r Sys.Date()`"
date: "Updated: `r Sys.Date()`"
output:
rmarkdown::html_document:
toc: true
toc_float: true
toc_depth: 3
number_sections: true
rmarkdown::pdf_document:
toc: true
toc_depth: 3
number_sections: true
---
# Introduction
......
---
title: "Visualizing fish movements with animated videos in R: The ggplot2 and gganimate packages"
subtitle: "Workshop Handout - GLATOS, March 27, 2018"
author: "Todd Hayden, Christopher Holbrook, Tom Binder, Mike Lowe"
date: "`r Sys.Date()`"
date: "Updated: `r Sys.Date()`"
output:
rmarkdown::html_document:
toc: true
toc_float: true
toc_depth: 3
number_sections: true
rmarkdown::pdf_document:
toc: true
toc_depth: 3
number_sections: true
---
# Introduction
......
library(rmarkdown)
library(tint)
render(input = "~/Documents/glatos/vignettes/gganimate_vignette.Rmd", output_file = "gganimate.pdf",
output_format = tint::tintPdf(highlight = "haddock"), clean=TRUE)
library(rmarkdown)
library(tint)
render(input = "inst/user_guides/detection_range_vignette.Rmd",
output_file = "detection_range_vignette.pdf",
output_dir = "vignettes",
output_format = tint::tintPdf(highlight = "haddock"))
render(input = "inst/user_guides/detection_range_vignette.Rmd",
output_file = "detection_range_vignette.html",
output_dir = "vignettes",
output_format = tint::tintHtml(highlight = "haddock"))
library(rmarkdown)
render(input = "inst/supplemental_docs/workshop_handouts/receiver_efficiency.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/supplemental_docs/workshop_handouts/residence_index.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/supplemental_docs/workshop_handouts/detection_range_vignette.Rmd",
output_dir = "vignettes",
output_format = "all")
render(input = "inst/supplemental_docs/workshop_handouts/gganimate_vignette.Rmd",
output_dir = "vignettes",
output_format = "all")
---
title: "Residence Index"
subtitle: "Workshop Handout - GLATOS, March 27, 2018"
author: "Alex Nunes"
date: "Updated: `r Sys.Date()`"
output:
rmarkdown::pdf_document:
rmarkdown::html_document:
toc: true
toc_float: true
toc_depth: 3
number_sections: true
rmarkdown::html_document:
rmarkdown::pdf_document:
toc: true
toc_depth: 3
number_sections: true
vignette: >
%\VignetteIndexEntry{Residence Index}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
......
......@@ -6,7 +6,7 @@
\usage{
crw_in_polygon(polyg, theta = c(0, 10), stepLen = 100,
initPos = c(NA, NA), initHeading = NA, nsteps = 30, EPSG = 3175,
sp_out = TRUE)
sp_out = TRUE, show_progress = TRUE)
}
\arguments{
\item{polyg}{A \code{\link[sp]{SpatialPolygons}} object.
......@@ -36,6 +36,9 @@ Great Lakes Basin and St. Lawrence River system.
\item{sp_out}{Logical. If TRUE (default) then output is a
\link[sp]{SpatialPoints} object. If FALSE, then output is a
data.frame.}
\item{show_progress}{Logical. Progress bar and status messages will be
shown if TRUE (default) and not shown if FALSE.}
}
\value{
A \link[sp]{SpatialPoints} object in the same CRS as the input
......
receiver_efficiency.pdf
data_loading.pdf
residence_index.pdf
data_requirements.pdf
receiver_efficiency.html
data_loading.html
residence_index.pdf
residence_index.html
data_requirements.html
\ No newline at end of file
detection_range_vignette.html
detection_range_vignette.pdf
gganimate.html
gganimate.pdf
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -369,7 +369,7 @@ $(document).ready(function () {
<h1 class="title toc-ignore">Receiver Efficiency Index</h1>
<h4 class="date"><em>Updated: 2019-02-22</em></h4>
<h4 class="date"><em>Updated: 2019-02-23</em></h4>
</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment