Skip to content

Commit

Permalink
Rename functions
Browse files Browse the repository at this point in the history
  • Loading branch information
GegznaV committed Dec 14, 2021
1 parent 8ca4dd1 commit ae67ab1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions data-raw/chondro.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ chondro_0$x[500] <- chondro_0$x[500] + rnorm(1, sd = 0.01)
chondro_0$y[660] <- chondro_0$y[660] + rnorm(1, sd = 0.01)

# Pre-process ----------------------------------------------------------------
chondro_0$x <- fitraster(chondro_0$x)$x
chondro_0$y <- fitraster(chondro_0$y)$x
chondro_0$x <- raster_fit(chondro_0$x)$x
chondro_0$y <- raster_fit(chondro_0$y)$x

chondro_0 <- spc_loess(chondro_0, seq(602, 1800, 4))
spectra_to_save <- chondro_0
Expand Down
14 changes: 7 additions & 7 deletions vignettes/hySpc-chondro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ irregular_grid_b <- as.ggplot(
<!-- --------------------------------------------------------------------- -->


Such slight rounding errors can be corrected by `fitraster()`{.r} or `makeraster()`{.r}.
Function `fitraster()`{.r} needs the step size of the raster and a starting coordinate, whereas `makeraster()`{.r} tries to guess these parameters for `fitraster()`{.r}.
As long as just a few points are affected by rounding errors, `makeraster()`{.r} works fine:
Such slight rounding errors can be corrected by `raster_fit()`{.r} or `raster_make()`{.r}.
Function `raster_fit()`{.r} needs the step size of the raster and a starting coordinate, whereas `raster_make()`{.r} tries to guess these parameters for `raster_fit()`{.r}.
As long as just a few points are affected by rounding errors, `raster_make()`{.r} works fine:

```{r}
chondro$x <- fitraster(chondro$x)$x
chondro$y <- fitraster(chondro$y)$x
chondro$x <- raster_fit(chondro$x)$x
chondro$y <- raster_fit(chondro$y)$x
```
the result is shown in figure \@ref(fig:irregular-c).

Expand Down Expand Up @@ -483,7 +483,7 @@ pairs(scores[[, , 1:7]], pch = 19, cex = 0.5)
```

Now the spectra can be found either by plotting two scores against each other (by `plot()`{.r}) and identifying with `identify()`{.r}, or they can be identified in the score map by `map.identify()`{.r}.
There is also a function to identify spectra in a spectra plot, `spc.identify()`{.r}, which could be used to identify principal components that are heavily influenced, e.g., by cosmic ray spikes.
There is also a function to identify spectra in a spectra plot, `identify_spc()`{.r}, which could be used to identify principal components that are heavily influenced, e.g., by cosmic ray spikes.

```{r pca-identify, eval=FALSE}
## omit the first 4 PCs
Expand Down Expand Up @@ -619,7 +619,7 @@ CAPTION <- "Hierarchical cluster analysis: the dendrogram."
```{r dend, fig.cap=CAPTION}
par(xpd = TRUE) # allow plotting the markers into the margin
plot(dendrogram, labels = FALSE, hang = -1)
mark.dendrogram(dendrogram, chondro$clusters, col = cols)
mark_groups_in_dendrogram(dendrogram, chondro$clusters, col = cols)
```

Figure \@ref(fig:dend) shows the dendrogram and \@ref(fig:clustmap) the resulting cluster map.
Expand Down

0 comments on commit ae67ab1

Please sign in to comment.