diff --git a/R/def_features.R b/R/def_features.R index 7c167add..ce71a989 100644 --- a/R/def_features.R +++ b/R/def_features.R @@ -19,11 +19,10 @@ #' collapsed for the features. #' #' @examples -#' \dontrun{ #' tiny_map <- read_extdata("CA_tiny_map.zip") |> read_any() #' identified_map <- def_features(tiny_map, tiny_map$metadata$x == 0) #' collapse_spec(identified_map) -#' } +#' #' @param x an \code{OpenSpecy} object #' @param features a logical vector or character vector describing which of the #' spectra are of features (\code{TRUE}) and which are not (\code{FALSE}). diff --git a/R/interactive_plots.R b/R/interactive_plots.R index 5b13a0ad..034cc817 100644 --- a/R/interactive_plots.R +++ b/R/interactive_plots.R @@ -41,7 +41,6 @@ #' spectra from the \code{OpenSpecy} object(s). #' #' @examples -#' \dontrun{ #' data("raman_hdpe") #' tiny_map <- read_extdata("CA_tiny_map.zip") |> read_zip() #' plotly_spec(raman_hdpe) @@ -50,8 +49,7 @@ #' #' sample_spec(tiny_map, size = 12) |> #' interactive_plot(select = 2, x2 = raman_hdpe) -#' } -#' +#' #' @author #' Win Cowger, Zacharias Steinmetz #' @@ -86,18 +84,18 @@ plotly_spec.OpenSpecy <- function(x, x2 = NULL, melt(id.vars = "wavenumber", variable.name = "id", value.name = "intensity") p <- plot_ly(dt, type = "scatter", mode = "lines") |> - add_trace(x = ~wavenumber, + add_trace(x = ~wavenumber, y = ~intensity, - split = ~id, + split = ~id, line = line, - name = "x1", + name = "x1", showlegend = F) |> layout(xaxis = list(title = "wavenumber [cm-1]", autorange = "reversed"), yaxis = list(title = "intensity [-]"), plot_bgcolor = plot_bgcolor, paper_bgcolor = paper_bgcolor, - legend = list(orientation = 'h', y = 1.1), + legend = list(orientation = 'h', y = 1.1), font = font) # Add dummy trace for Your Spectra @@ -167,7 +165,7 @@ heatmap_spec.OpenSpecy <- function(x, if(all(is.na(plot_z))) plot_z = rep(-88, length.out = length(plot_z)) - + p <- plot_ly(...) |> add_trace(x = x$metadata$x, y = x$metadata$y, z = if(!is.numeric(plot_z)){as.numeric(as.factor(plot_z))} else{plot_z}, colorscale = colorscale, type = "heatmap", hoverinfo = 'text', diff --git a/R/read_multi.R b/R/read_multi.R index 1ac37ad3..7dbc10d3 100644 --- a/R/read_multi.R +++ b/R/read_multi.R @@ -19,13 +19,11 @@ #' All \code{read_*()} functions return \code{OpenSpecy} objects #' #' @examples -#' \dontrun{ #' read_extdata("raman_hdpe.csv") |> read_any() #' read_extdata("ftir_ldpe_soil.asp") |> read_any() #' read_extdata("testdata_zipped.zip") |> read_zip() #' read_extdata("CA_tiny_map.zip") |> read_zip() -#' } -#' +#' #' @author #' Zacharias Steinmetz, Win Cowger #'