Hello, sorry for that, here it is again.
even before the other error i mentioned i've got problems here
library(DescTools)
library(wavScalogram)
signals <- data.frame(
Accipiter_cooperii = c(0L,
0L,0L,0L,0L,0L),
Actitis_macularius = c(0L,
0L,0L,0L,0L,0L),
Amazilia_beryllina = c(0L,
0L,0L,0L,0L,0L),
Amazona_autumnalis = c(0L,
0L,0L,0L,0L,0L),
Amazona_oratrix = c(0L,
0L,0L,0L,0L,0L),
Amazona_viridigenalis = c(0L,
0L,0L,0L,0L,0L),
Anas_discors = c(0L,
0L,0L,1L,1L,0L),
Anas_diazi = c(12L,
10L,9L,10L,15L,12L),
Anas_platyrhynchos_domesticus = c(0L,
0L,3L,0L,0L,2L),
Ardea_alba = c(0L,
0L,0L,0L,0L,0L),
Aythya_collaris = c(0L,
2L,0L,0L,0L,0L),
Bombycilla_cedrorum = c(0L,
0L,0L,0L,1L,5L),
Butorides_virescens = c(0L,
0L,1L,0L,0L,0L),
Cardellina_pusilla = c(0L,
1L,0L,1L,0L,0L),
Columbina_inca = c(0L,
0L,0L,2L,2L,0L),
Contopus = c(0L,
0L,0L,0L,0L,0L),
Dryobates_scalaris = c(0L,
0L,0L,3L,0L,0L),
Empidonax = c(1L,
1L,3L,1L,0L,0L),
Fulica_americana = c(0L,
2L,1L,0L,1L,0L),
Geothlypis_trichas = c(0L,
0L,0L,0L,0L,0L),
Haemorhous_mexicanus = c(0L,
0L,2L,2L,4L,2L),
Hirundo_rustica = c(0L,
0L,0L,0L,0L,0L),
Icterus_bullockii = c(0L,
0L,0L,0L,0L,0L),
Icterus_spurius = c(0L,
0L,0L,0L,0L,0L),
Lampornis_clemenciae = c(0L,
0L,0L,0L,0L,0L),
Leiothlypis_celata = c(2L,
0L,2L,0L,1L,1L),
Leiothlypis_ruficapilla = c(0L,
0L,0L,0L,0L,0L),
Melanerpes_aurifrons = c(0L,
0L,0L,0L,0L,0L),
Melospiza_melodia = c(0L,
0L,0L,0L,0L,0L),
Melozone_fusca = c(0L,
0L,0L,0L,0L,0L),
Mimus_polyglottos = c(0L,
0L,0L,0L,0L,0L),
Mniotilta_varia = c(1L,
0L,0L,0L,1L,0L),
Molothrus_aeneus = c(0L,
0L,0L,0L,0L,0L),
Myiarchus_cinerascens = c(0L,
0L,0L,0L,0L,0L),
Myiopsitta_monachus = c(0L,
0L,0L,0L,0L,0L),
Parabuteo_unicinctus = c(0L,
0L,0L,0L,0L,0L),
Passer_domesticus = c(2L,
0L,0L,0L,0L,0L),
Passerina_cyanea = c(0L,
0L,0L,0L,0L,0L),
Pheucticus_melanocephalus = c(0L,
0L,0L,0L,0L,0L),
Piranga_flava = c(0L,
0L,0L,0L,0L,0L),
Piranga_ludoviciana = c(0L,
0L,0L,0L,0L,0L),
Podilymbus_podiceps = c(0L,
0L,0L,0L,1L,0L),
Polioptila_caerulea = c(1L,
3L,0L,0L,1L,1L),
Psaltriparus_minimus = c(0L,
0L,0L,0L,0L,0L),
Ptilogonis_cinereus = c(0L,
0L,0L,0L,0L,0L),
Pyrocephalus_rubinus = c(1L,
1L,3L,4L,6L,1L),
Quiscalus_mexicanus = c(5L,
1L,4L,4L,7L,1L),
Rhodothraupis_celaeno = c(0L,
0L,0L,0L,0L,0L),
Setophaga_coronata = c(8L,
5L,4L,2L,4L,4L),
Spatula_clypeata = c(2L,
8L,25L,15L,2L,0L),
Spinus_psaltria = c(0L,
0L,0L,0L,0L,0L),
Spizella_passerina = c(0L,
0L,0L,4L,2L,15L),
Streptopelia_decaocto = c(0L,
0L,0L,0L,0L,0L),
Sturnus_vulgaris = c(0L,
0L,0L,0L,0L,0L),
Thryomanes_bewickii = c(1L,
0L,1L,7L,0L,0L),
Toxostoma_curvirostre = c(0L,
0L,0L,0L,0L,0L),
Troglodytes_aedon = c(0L,
0L,0L,0L,0L,2L),
Turdus_migratorius = c(1L,
0L,2L,1L,0L,2L),
Turdus_rufopalliatus = c(0L,
0L,0L,0L,0L,0L),
Tyrannus_vociferans = c(0L,
0L,0L,0L,0L,0L),
Vireo = c(0L,
0L,0L,0L,0L,0L),
Vireo_flavifrons = c(0L,
0L,0L,0L,0L,0L),
Vireo_huttoni = c(0L,
0L,0L,0L,0L,0L),
Zenaida_macroura = c(0L,
0L,0L,0L,0L,0L),
Zenaida_asiatica = c(0L,
0L,0L,0L,0L,0L)
)
dt <- 4
tau <- 2
colores <- rainbow(65)
n.time <- nrow(signals)
n.spp <- ncol(signals)
time <- 1:n.time
RelSpPhCumInt <- rep(NA, n.spp)
wSpPhInt <- SpPhInt <- matrix(NA, nrow = n.time, ncol = n.spp)
for (i in 1:n.spp) {
SpPhPat <- signals[, i]
RelSpPhCumInt[i] <- sum(SpPhPat)
if (sd(SpPhPat) == 0)
SpPhInt[, i] <- SpPhPat/sum(SpPhPat)
if (sd(SpPhPat) > 0) {
wavelet <- cwt_wst(signal = SpPhPat, dt = dt, makefigure = FALSE)
z <- abs(wavelet$coefs)^tau
SpPhInt[, i] <- rowSums(z)/sum(z)
}
}
#Error in cwt_wst(signal = SpPhPat, dt = dt, makefigure = FALSE) :
#could not find function "cwt_wst"
Created on 2021-09-08 by the reprex package (v2.0.1)