-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
Dear package authors, I'm studying the book "Functional Data Analysis with R and MATLAB" with the companion scripts and I think I've found a bug in density.fd as highlighted by the following example (taken from the code used in Section 5.4.3):
library(fda)
#> Loading required package: splines
#> Loading required package: fds
#> Loading required package: rainbow
#> Loading required package: MASS
#> Loading required package: pcaPP
#> Loading required package: RCurl
#> Loading required package: deSolve
#>
#> Attaching package: 'fda'
#> The following object is masked from 'package:graphics':
#>
#> matplot
sel2.45 = ((2 <= ReginaPrecip) & (ReginaPrecip <= 45))
RegPrec = sort(ReginaPrecip[sel2.45])
N = length(RegPrec)
Wknots = RegPrec[round(N*seq(1/N,1,len=11),0)]
Wnbasis = length(Wknots) + 2
Wbasis = create.bspline.basis(range(RegPrec),13,4,Wknots)
Wlambda = 1e-1
WfdPar = fdPar(Wbasis, 2, Wlambda)
densityList = density.fd(RegPrec, WfdPar)
#> Error in smat[1, ] <- width * as.vector(sumj)/2: number of items to replace is not a multiple of replacement length
Created on 2024-09-05 with reprex v2.0.2
Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.1 (2023-06-16 ucrt)
#> os Windows 11 x64 (build 22631)
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United Kingdom.utf8
#> ctype English_United Kingdom.utf8
#> tz Europe/Rome
#> date 2024-09-05
#> pandoc 3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> bitops 1.0-7 2021-04-24 [1] CRAN (R 4.3.1)
#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.3)
#> cluster 2.1.4 2022-08-22 [2] CRAN (R 4.3.1)
#> colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.1)
#> deSolve * 1.38 2023-09-05 [1] CRAN (R 4.3.1)
#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3)
#> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.3.3)
#> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.3.3)
#> fda * 6.1.9 2024-09-05 [1] Github (JamesRamsay5/fda@04f5616)
#> fds * 1.8 2018-10-31 [1] CRAN (R 4.3.1)
#> fs 1.6.4 2024-04-25 [1] CRAN (R 4.3.3)
#> glue 1.7.0 2024-01-09 [1] CRAN (R 4.3.2)
#> hdrcde 3.4 2021-01-18 [1] CRAN (R 4.3.1)
#> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.3.3)
#> KernSmooth 2.23-21 2023-05-03 [2] CRAN (R 4.3.1)
#> knitr 1.48 2024-07-07 [1] CRAN (R 4.3.3)
#> ks 1.14.1 2023-08-10 [1] CRAN (R 4.3.1)
#> lattice 0.21-8 2023-04-05 [2] CRAN (R 4.3.1)
#> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.3.2)
#> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.1)
#> MASS * 7.3-60 2023-05-04 [2] CRAN (R 4.3.1)
#> Matrix 1.6-1.1 2023-09-18 [1] CRAN (R 4.3.1)
#> mclust 6.0.0 2022-10-31 [1] CRAN (R 4.3.1)
#> mvtnorm 1.2-3 2023-08-25 [1] CRAN (R 4.3.1)
#> pcaPP * 2.0-3 2022-10-24 [1] CRAN (R 4.3.1)
#> pracma 2.4.2 2022-09-22 [1] CRAN (R 4.3.1)
#> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.3.1)
#> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.3.1)
#> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.3.1)
#> R.oo 1.25.0 2022-06-12 [1] CRAN (R 4.3.1)
#> R.utils 2.12.2 2022-11-11 [1] CRAN (R 4.3.1)
#> rainbow * 3.7 2022-10-09 [1] CRAN (R 4.3.1)
#> RCurl * 1.98-1.12 2023-03-27 [1] CRAN (R 4.3.1)
#> reprex 2.0.2 2022-08-17 [1] CRAN (R 4.3.1)
#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1)
#> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.3.3)
#> rstudioapi 0.16.0 2024-03-24 [1] CRAN (R 4.3.1)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.1)
#> styler 1.10.2 2023-08-29 [1] CRAN (R 4.3.1)
#> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.3.2)
#> withr 3.0.0 2024-01-16 [1] CRAN (R 4.3.1)
#> xfun 0.45 2024-06-16 [1] CRAN (R 4.3.3)
#> yaml 2.3.9 2024-07-05 [1] CRAN (R 4.3.3)
#>
#> [1] C:/Users/user/AppData/Local/R/win-library/4.3
#> [2] C:/Program Files/R/R-4.3.1/library
#>
#> ──────────────────────────────────────────────────────────────────────────────
Metadata
Metadata
Assignees
Labels
No labels