Skip to content

Commit

Permalink
Resolved errors and warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenhartmeyer committed Jan 10, 2024
1 parent e5aec2d commit 97a7695
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 21 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Imports:
rsconnect,
scales,
shiny,
slider,
stats,
stringr,
tibble,
Expand Down
5 changes: 3 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export(Datetime_breaks)
export(Datetime_limits)
export(aggregate_Datetime)
export(bright_dark_period)
export(centroidLE)
export(count_difftime)
export(create_Timedata)
export(cut_Datetime)
Expand All @@ -24,12 +25,12 @@ export(gapless_Datetimes)
export(gg_day)
export(gg_days)
export(gg_overview)
export(interdaily_stability)
export(intradaily_variability)
export(import)
export(import_Dataset)
export(import_Statechanges)
export(interdaily_stability)
export(interval2state)
export(intradaily_variability)
export(join_datasets)
export(sc2interval)
export(sleep_int2Brown)
Expand Down
2 changes: 1 addition & 1 deletion R/metric_bright_dark_period.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ bright_dark_period <- function(Light.vector,

# Get the epochs based on the data
if (epoch == "dominant.epoch") {
epoch <- count.difftime(tibble::tibble(Datetime = Time.vector))$difftime[1]
epoch <- count_difftime(tibble::tibble(Datetime = Time.vector))$difftime[1]
}
# If the user specified an epoch, use that instead
epoch <- lubridate::as.duration(epoch)
Expand Down
2 changes: 1 addition & 1 deletion R/metric_duration_above_threshold.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ duration_above_threshold <- function(Light.vector,

# Get the epochs based on the data
if (epoch == "dominant.epoch") {
epoch <- count.difftime(tibble::tibble(Datetime = Time.vector))$difftime[1]
epoch <- count_difftime(tibble::tibble(Datetime = Time.vector))$difftime[1]
epoch <- ifelse(hms::is_hms(Time.vector) | lubridate::is.POSIXct(Time.vector),
lubridate::as.duration(epoch), epoch
)
Expand Down
6 changes: 3 additions & 3 deletions R/metric_interdaily_stability.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interdaily_stability <- function(Light.vector,
"Interdaily stability might not be meaningful for non-24 h days.",
"These days contain less than 24 h:",
paste(
capture.output(print(
utils::capture.output(print(
dplyr::filter(N_hours, N < 24) %>% dplyr::pull(Day)
)),
sep = "\n", collapse = "\n"
Expand All @@ -97,7 +97,7 @@ interdaily_stability <- function(Light.vector,
"Data contains some hours with only missing values",
"These hours contain only missing values: ",
paste(
capture.output(print(
utils::capture.output(print(
dplyr::filter(hours_per_day, is_missing) %>% dplyr::pull(Hour)
)),
sep = "\n", collapse = "\n"
Expand All @@ -123,7 +123,7 @@ interdaily_stability <- function(Light.vector,
dplyr::summarise(Light = mean(Light))

# Variance across average day / variance across all days
is <- var(avg_hourly$Light) / var(total_hourly$Light)
is <- stats::var(avg_hourly$Light) / stats::var(total_hourly$Light)

# Return data frame or numeric vector
if (as.df) {
Expand Down
6 changes: 3 additions & 3 deletions R/metric_intradaily_variability.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ intradaily_variability <- function(Light.vector,
"Intradaily variability might not be meaningful for non-24 h days.",
"These days contain less than 24 h:",
paste(
capture.output(print(
utils::capture.output(print(
dplyr::filter(N_hours, N < 24) %>% dplyr::pull(Day)
)),
sep = "\n", collapse = "\n"
Expand All @@ -95,7 +95,7 @@ intradaily_variability <- function(Light.vector,
"Data contains some hours with only missing values",
"These hours contain only missing values: ",
paste(
capture.output(print(
utils::capture.output(print(
dplyr::filter(hours_per_day, is_missing) %>% dplyr::pull(Hour)
)),
sep = "\n", collapse = "\n"
Expand All @@ -120,7 +120,7 @@ intradaily_variability <- function(Light.vector,
sum(diff(total_hourly$Light)^2) / (length(total_hourly$Light) - 1)

# Variance of consecutive differences / variance across all days
iv <- var_hourly_diff / var(total_hourly$Light)
iv <- var_hourly_diff / stats::var(total_hourly$Light)

# Return data frame or numeric vector
if (as.df) {
Expand Down
1 change: 1 addition & 0 deletions man/LightLogR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/bright_dark_period.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/duration_above_threshold.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions man/import_Dataset.Rd

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion man/interdaily_stability.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/intradaily_variability.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion man/timing_above_threshold.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 97a7695

Please sign in to comment.