Skip to content

Commit

Permalink
minor code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
craddm committed Oct 18, 2023
1 parent a7227f1 commit 3ac0d1d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 17 deletions.
3 changes: 0 additions & 3 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@ importFrom(future.apply,future_lapply)
importFrom(ggplot2,fortify)
importFrom(graphics,abline)
importFrom(graphics,par)
importFrom(plotly,event_data)
importFrom(plotly,plot_ly)
importFrom(plotly,renderPlotly)
importFrom(pracma,legendre)
importFrom(purrr,is_empty)
importFrom(purrr,map)
Expand Down
19 changes: 9 additions & 10 deletions R/artefact_viewer.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#' Artefact browser
#'
#' An interactive Shiny app that allows exploration of channel and epoch
#' statistics.
#' statistics
#'
#' @author Matt Craddock \email{matt@@mattcraddock.com}
#' @import shiny
#' @import ggplot2
#' @importFrom plotly plot_ly renderPlotly event_data
#' @param data Object to be explored.
#' @return Nothing.
#' @examples
Expand Down Expand Up @@ -35,13 +34,13 @@ view_artefacts <- function(data) {
tabPanel("Channel stats",
sidebarLayout(
sidebarPanel(selectInput("chan_meas",
"Display measures",
choices = c("means",
"sds",
"variance",
"kurtosis",
"minmax")
),
"Display measures",
choices = c("means",
"sds",
"variance",
"kurtosis",
"minmax")
),
checkboxInput("std_meas",
"Standardize?"),
width = 3),
Expand Down Expand Up @@ -87,7 +86,7 @@ view_artefacts <- function(data) {
if (length(s)) {
plot_timecourse(data,
electrode = s[["x"]]) +
labs(y = "amplitude")
labs(y = "Amplitude")
}
})

Expand Down
2 changes: 1 addition & 1 deletion R/data_averaging.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ eeg_average <- function(data,

eeg_average.default <- function(data,
...) {
stop("eeg_epochs or eeg_tfr object required as input.")
stop(paste("Cannot average an object of class", class(data)))
}

#' @describeIn eeg_average Create evoked data from `eeg_epochs`objects
Expand Down
3 changes: 1 addition & 2 deletions R/filtering.R
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ filter_coefs <- function(method,
coefs[[i]] <- filt_kernel(filter_order,
filt_pars$W[[i]],
win)
if (identical(filt_pars$filt_type,
"high")) {
if (identical(filt_pars$filt_type, "high")) {
coefs[[i]] <- spec_inv(coefs[[i]])
}
if (i == 2) {
Expand Down
2 changes: 1 addition & 1 deletion man/view_artefacts.Rd

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

0 comments on commit 3ac0d1d

Please sign in to comment.